audit records

spinkung

Registered User.
Local time
Today, 17:48
Joined
Dec 4, 2006
Messages
267
Hi

I have a form that gets updated regularly. I want to create an audit of changes made to records.

How can i get the value of the field with focus (to insert into a table) without placing an event on every form control?

thanks
 
Hi

Me.ActiveControl.Value may be what you're looking for.
 
thanks bob.

I think that's definitely the correct code to get the value but what i need is an event that is triggered by a change to the form NOT the control, otherwise i'll have to go through every form control and add something like an after update event.

That would be a pain as there are lots of controls on the form.


** edit 13.06.2011 15:39

I tried on dirty which seems to work how i want but only for the first field change. i need to then reset the OnDirty value to = false but that causes me to get stuck in a loop.

i.e....

Code:
Private Sub Form_Dirty(Cancel As Integer)
MsgBox MyForm.ActiveControl.Value
If Me.Dirty = False Then Me.Dirty = True
End Sub
 
Hi
Could you use the form's OnDirty event to catch the change, do whatever you need to do, then set Me.Dirty = False which will reset the dirty value and save the current record?
 
i tried using the OnDirty event for the form which does fire when i make a change to one of the forms controls but if i set OnDirty = True after i've made my insert it fires the OnDirty event again so i get stuck inside the OnDirty event.

If i change it to OnDirty = false then then the next change i make doesn;t trigger the event.
 

Users who are viewing this thread

Back
Top Bottom