Current date and time default?

  • Thread starter Thread starter Dave L
  • Start date Start date
D

Dave L

Hi all!

How do I get Access to update a field in a form with a default value such as
Now()? I want this to occur when a record is being updated/changed. I do
not enter new records; I just update existing records. I know about the
ctrl-alt-spacebar thing but I want the default date and time to appear as I
enter that field. Basically I want to just tab through the field and have
the current date and time appear in that field.

The form I'm using uses a query to filter some data. Does this make a
difference in how this needs to be done?

Thanks in advance!
 
In the form's Dirty event, which occurs every time a record it added, or
edited, use a bit of code like:

Sub Form_Dirty(Cancel As Integer)
Me.NameOfTextBox = Now()
End Sub
 
I put a save command button on my form (even though I know you don't HAVE to
have a save button) and then in onclick event I put
Me.last_updated = Now()
Put a last updated column in your table and it will save that for you.
 
Back
Top