On Change [Event Procedure]

grinder332518

Registered User.
Local time
Today, 16:56
Joined
Jun 22, 2009
Messages
28
My table X has a field “DateLastUpdated”, along with 7 other fields.
I wish to set this field to today’s date whenever any of the 7 others change.
To do this, I suspect I can set an ‘On Change’ [Event Procedure] for each of the 7, but is there a better way of doing this ?

And can you suggest what the vb coding might be,
as I am a complete novice.

This field should also be set when a new record is written to table X.

Many thanks
 
I think you should look at the form events rather than control events, in this case look at the On Dirty or After Update event of the form, which should take into account all of the controls on the form.

If you look at the help system it should explain and then you can get the DateFieled updated accordingly
 
Thanks Trevor G
My Form is working fine now.

:D
 
grinder - the best way is to use the froms before update event

at this point, you are saving the changed record. this is the normal point at which you would set any "info fields" such as who did it, when, and on what machnie, maybe even which process they were using etc etc

doing it at this point means you only need to code once, rather than on every field - also if you cancel the edit, the event wont fire, and you wont save "false" information
 

Users who are viewing this thread

Back
Top Bottom