AUTOMATIC UPDATE

A

Alimbilo

How can I set my form to update my fields as soon as a data changed?
I tried to do the AFTERUPDATE, BEFOREUPDATE, ONLOAD, but they are all not
doing it really. I have to close the form and reopen it for the code to work.

Can anybody help?
 
J

John W. Vinson

How can I set my form to update my fields as soon as a data changed?
I tried to do the AFTERUPDATE, BEFOREUPDATE, ONLOAD, but they are all not
doing it really. I have to close the form and reopen it for the code to work.

Can anybody help?

You could put code in the AfterUpdate event of each textbox for which you want
this to happen; this code will save the record to disk:

Private Sub controlname_AfterUpdate()
If Me.Dirty Then
Me.Dirty = False
End If
End Sub

Ordinarily this would not be necessary - the record will be automatically
saved to disk as soon as you move off the record to a different record; and if
you are still on the record, it will show whatever has been typed into it
without any code (and, I admit, without yet saving it to disk). Why do you
feel that special handling is necessary??
 
Top