Full Version: How to know if user has updated a field on the form?
UtterAccess Discussion Forums > Microsoft® Access > Access Forms
nono270980
Hi,

I have a maintenance form where users will key in a primary ID to retrieve a record for updating.

Can the system know if the records has been "touched" - means updated before? As i would like to force my users to save the record if any of the fields on the form has been updated.


This is because:
Currently, my system is encountering problems where the records inputted by the users gone missing after a few days in the database and i have no idea why this happens. Any one knows about this problem? How can i prevent that?


Thanks
nono
RuralGuy
Unless you take extra steps, any record that is changed in access through a form is saved.
wjholtjr
You can test the me.Dirty value. If true then you need to save the record.

Test it using this logic
If Me.Dirty Then
<do something here>
End If

You don't really have to test it as long as you know if the user is closing the form or leaving the current record. Just put this in your exit code:

Me.Dirty = False

That forces a Save.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.