displaying date and time

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
 
F

Fritz Range

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top