View Full Version : Date Stamp


RJ
05-22-2001, 08:05 PM
Hi all

Couldn't find this when I searched on date stamping in the archives. Could someone please enlighten me please.
I wish to date stamp records when they are created and not have that field altered when the record is edited (so as to ensure that users cannot the field is not altered to backdate any records). I only have a little VB experience but am keen to get more so advise on doing it in VB would be appreciated.

Thanks in advance

Richard

Robert Saye
05-23-2001, 02:35 AM
Hi Richard,

You can do this easy enough without any VB. On the properties sheet for your date control (Text Box) set the default value to Date(). Then set the Locked value to yes.

HTH
Robert

itchy
05-23-2001, 04:10 AM
Hi, what if you did want the date to change as the record is altered? Sort of a last updated field? Would you simply set the locked property to no?

Thanks

Pat Hartman
05-23-2001, 05:26 AM
To maintain a LastUpdatedDT field add a line of code to the BeforeUpdate event of the FORM.

Me.LastUpdateDT = Now()

Now() returns the current date and time. If you show LastUpdateDT on the form, the control should be locked and disabled to prevent updates by users.