pyrahna <pl*******@gmail.comwrote:
>I have an access form that connects to a database on a main server.
These forms stay open for a long length of time (a couple hours) and
then the user finishes with them and closes the form. The problem
that has been occurring is that sometimes for whatever reason the
connection to the server is broken and when the sheet is closed the
data is trying to commit to the database and can't. Is there a
setting to commit data to the database as soon as it is entered into a
field and not when the full record is closed/committed? Or is there
any other way to protect myself from this lose of data?
You could put the following code in behind every control on the form.
if me.dirty then docmd.runcommand accmdsaverecord.
thus saving the record after the user exits from each control. A bit inefficient if
they are going through a large number of fields rapidly.
Alternatively you could use a timer event and after x seconds of inactivity save the
record.
Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog -
http://msmvps.com/blogs/access/