Keep track of when form data has changed (1 Viewer)

TimTDP

Registered User.
Local time
Today, 03:45
Joined
Oct 24, 2008
Messages
210
I want to keep track of when data in a form was last changed.
I only need to track this when the form is closed. not every time a record is changed.

What event should I use?
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 01:45
Joined
Jul 9, 2003
Messages
16,285
Well there are several ways of tracking when data changes and its called "audit tracking" or "audit trail" you should be able to find examples within this forum. However none of them work when the form is closed so you would have to give a bit more information about what you are trying to do.
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 01:45
Joined
Jul 9, 2003
Messages
16,285
Ah! I think I understand. What you are really saying is you want to record what's changed when you close the form?
 

TimTDP

Registered User.
Local time
Today, 03:45
Joined
Oct 24, 2008
Messages
210
If a user opens the form and does nothing, then I am not interested

However if the user changes any data, than I only to know this when the form closes.
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 01:45
Joined
Jul 9, 2003
Messages
16,285
If that's the case then find the audit threads in this forum and use that code.

From memory what it does, it look at each controls "old value" and compare it to the current value if the value has changed then the code records the fact in an audit table. You would just need to change this code to fire when your forms on close event operates. However it will only record changes to the last record shown in the form.

So I think you should still provide some more detailed explanation of what you are trying to do.
 

vbaInet

AWF VIP
Local time
Today, 01:45
Joined
Jan 22, 2010
Messages
26,374
If a user opens the form and does nothing, then I am not interested
The user could still open the form, change data but revert it to it's old state, however the form's After Update event will still fire. So when coding for this you'll need to bear that in mind. That's why Uncle Gizmo has mentioned comparing each control's old value against the new value. But you only do this before the update otherwise they'll be no old value.
And you can save a list of the records that were changed (if users are allowed to make multiple record changes).

We'll wait for more information as requested.
 

Users who are viewing this thread

Top Bottom