Update Record before moving to new form?

R

Rick

I have a continuous form where people can view and enter information about
records in my database. The form displays all the open assignments for the
client or user entered.

In the detail section, I have a button. When pressed, it opens a form that
contains more detailed information for the record where the button was
pushed. If the user updates some of the information in my main form and
then clicks the button to open the pop-up form and enter additional
information, the info entered on the main form is not there. I need to add
something to my code that will update the record before opening the new
pop-up form.

Can someone tell me what line I need to insert to save the changes just
before I open the new form?

Thanks!

Rick
 
M

Marshall Barton

Rick said:
I have a continuous form where people can view and enter information about
records in my database. The form displays all the open assignments for the
client or user entered.

In the detail section, I have a button. When pressed, it opens a form that
contains more detailed information for the record where the button was
pushed. If the user updates some of the information in my main form and
then clicks the button to open the pop-up form and enter additional
information, the info entered on the main form is not there. I need to add
something to my code that will update the record before opening the new
pop-up form.

Can someone tell me what line I need to insert to save the changes just
before I open the new form?

Use:

If Me.Dirty Then Me.Dirty = False
 
R

Rick

Marsh -

Thanks!! When I read your response I thought I had not explained myself
very well. I was expecting something more like: docmd.saverecord

Have a good weekend!

Rick
 
M

Marshall Barton

Well, there is:

DoCmd.RunCommand acCmdSaveRecord

but I really don't like the DoCmd.RunCommand way of doing
things because there is no way to tell it what object it is
supposed to operate on. All it's doing is simulating a
mouse click on a menu item, which can also go haywire if
somthing happens to activate a different object than the one
you thought you were working with (e.g. another form's Timer
event).

It may be obscure, but at least the DIrty property belongs
to a specific form object.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top