default value date()

C

Christina

Hi, if you use the date() function as a default value in a
table, does it automatically update when you open the
table or actually modify a record? Is there a way to have
the creation date as the value, or a modification date
(I'm assuming both of these would require you to actually
edit the record in order for them to change). Thanks in
advance.
 
A

Allen Browne

DefaultValue applies only to the creation of the record, so you cannot use
that to record the modification date. Instead, use the BeforeUpdate event of
the form where edits are made:

Private Sub Form_BeforeUpdate(Cancel As Integer)
Me.[ModificationDate] = Date()
End Sub
 

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