displaying date and time

  • Thread starter Thread starter Juliet
  • Start date Start date
J

Juliet

Hello Everyone,

I want to know if it is possible to somehow display a date
and time automatically when a user either adds a new
record or edits the existing records. I want to be able to
keep track of what changes were made and when without the
user having to manually enter the date and time.

Thank you so much,
Juliet
 
You need to add a field to your table that is D
DateMod Date

PLace the DateMod Field on your form. Set the Format to
Visible = No if you do not want to have the users see it
or set the Data Property to Enabled = No. You then need
to create some code in a module

Function DateMod()
On error resume next
Forms!YourFormName![DateMod] = Now()
End Function

Assign this code to the On After Update event of any
fields on your form.


If you have several forms you can add additional lines to
your code.

Function DateMod()
On error resume next
Forms!YourFormName![DateMod] = Now()
Forms!YourFormName2![DateMod] = Now()
End Function
 
Back
Top