Save Data on form when exiting

  • Thread starter Thread starter mattc66 via AccessMonster.com
  • Start date Start date
M

mattc66 via AccessMonster.com

How do I save the data to the table when exiting a form or when moving to one
form and then back to the orginal form.

Matt
 
Access automatically saves the record in the form when you close it. Well,
except for this bug it does:
Losing data when you close a form
at:
http://allenbrowne.com/bug-01.html

If you want to force the save as soon as a form loses the focus (typically
becuase you opened another form or report without closing the first one),
you could use the Deactivate event of the form. Before you do that, you
might like to think through the implications of that idea. For example, what
if the record is not complete enough to save yet, e.g. some required fields
are not filled in? And what if the user is opening something else in order
to get the data that they need in order to complete the entry? Do you really
want them to have to lose what they have entered so they can look up some
data, and then have to start the entry again?

Or are there specific circumstances when the record need to be saved? For
example, if you are going to print the record, or open another form via a
button on this form, you could very easily do the explicit save in the
button's event procedure before opening the next object. Simple example in:
Print the record in the form
at:
http://allenbrowne.com/casu-15.html
 
Back
Top