Date update question

EjS

Registered User.
Local time
Today, 02:57
Joined
Jul 17, 2002
Messages
13
I have a date field that is set to automatically put the current date in when a new record is entered. Is there a way to make the date change to a new date if I update the record? Say I make a change today, and the date field automatically changes to today? Thank you!
 
You ought to be able to put a line in the AfterUpdate of your form that updates the date field...

Me.RecordDate = Date()

HTH
Chris
 
Thank you. I put that expression in and changed a record but it didn't put today's date.????
 
Sorry, should have been more clear. Where is says RecordDate you should put the name of the control that hold your date value on the form. I am assuming that you have bound this control to a table field as well...
Chris
 
Thanks for the help--I'm a beginner!:)
 
DO NOT USE THE AFTERUPDATE EVENT OF THE FORM TO MODIFY THE CURRENT RECORD! IT CAUSES A NEVER ENDING LOOP.
Was that emphatic enough? I didn't equivocate did I. Use the BeforeUpdate event. The BeforeUpdate event is the LAST event fired before the current record is saved. The AfterUpdate event is the first event fired AFTER the current record is saved. Putting code in the AfterUpdate event that dirties the current record, causes Access to have to execute the BeforeUpdate event again, save the record, execute the AfterUpdate event, which now dirties the record causing Access to have to execute the BeforeUpdate event, save the record, execute the AfterUpdate event.... Are you getting the picture?
 
Last edited:

Users who are viewing this thread

Back
Top Bottom