Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Immediate Data Update

Status
Not open for further replies.

waldemar

Programmer
Nov 15, 2001
245
0
0
DE

I feel almost embarrased to ask such a simple question. I guess this issue arrises not in a single user environment...

After the user enters some data in a bound field in a form (dirty) the database is not immediately updated. As far as I know this happens upon leaving the form or jumping between the records...

So what is the "common procedure" to immediately update the database? Will "DoCmd.RunCommand acCmdSaveRecord" in the AfterUpdate of the Form or every Field do the trick? Or what is the most elegant way?
 
I don't know about elegant and all of that stuff, but if you let the control wizard build a command button, one of the options is to save a record. It does so using the menu bars. Let it create the code for you and then drop it in the after update event of whatever control you need. The record is normally updated when the form moves to a different record.

Good Luck!
 
It won't work in the form's AfterUpdate event procedure because its not called until after the record has been updated. To the best of my knowledge, it would have to be in the AfterUpdate event procedure of every field that you would want to be immediately changed in the DB.
Another option would be to use the timer event for the form. That would make me a nervous though, as it may execute the save record while the user is in the middle of changing another field (if you have text boxes).

Kevin
:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top