Saving record

  • Thread starter Thread starter Dan
  • Start date Start date
D

Dan

I have 2 forms that the user enters information into for
the same record. There is a button that they click that
just opens the next form and finds the same record, they
enter the additional information and then closes the
second form and returns back to the first.

However it normally says something about another user has
changed the record and askes if they want to save the
record or drop the changes. What would be the best way to
resolve this? I thought about having it flip to another
record once the form becomes deactivated and then return
to it and find the same record, but I have had a hard
time flipping back to the right record. Is there a better
solution than this? How can I have a variable or
something that will remember the record and can be used
on the deactiviated/activated event procedures.
 
Dan,

I think it will probably solve the problem to put this code...
DoCmd.RunCommand acCmdSaveRecord
.... in the Click event procedure on the command button, before the code
that opens the second form.

However, an alternative approach to consider, possibly neater way to do
it, is to not use 2 forms at all. Just use one form, with a Tab
Control. All the controls you currently have on your existing first
form can go on one page of the tab control, and the controls on your
existing second form go on another page of the tab control. Then,
instead of opening a new form to enter your second lot of data, you just
toggle between the tabs.
 
Back
Top