467,894 Members | 1,469 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,894 developers. It's quick & easy.

Updating a record from Access to an SQL 2005 database

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?

Jul 19 '07 #1
  • viewed: 1105
Share:
1 Reply
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/
Jul 19 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by junglist | last post: by
1 post views Thread by Spock | last post: by
6 posts views Thread by Fred Geurtsen | last post: by
2 posts views Thread by barret bonden | last post: by
reply views Thread by wildlifecanada | last post: by
4 posts views Thread by MooVBuff | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.