Date of the last time a record was saved

  • Thread starter Thread starter Nick
  • Start date Start date
N

Nick

Im trying to insert todays date into a form which, when a button is pressed,
will save the information in the form as well as the date on the form into a
field in a table.
Im using it to call clients and log the date I called them, so that I can
look back in the table to see when each client was last contacted.
Any help is greatly appreciated
cheers
 
Put logic in the form's BeforeUpdate event. Something like:

Private Sub Form_BeforeUpdate(Cancel As Integer)

Me!LastUpdated = Now()

End Sub
 
Nick said:
Im trying to insert todays date into a form which, when a button is
pressed,
will save the information in the form as well as the date on the form into
a
field in a table.

That makes no sense. Data is stored in fields in tables. Forms are bound
to tables and used to manipulate the data.
Im using it to call clients and log the date I called them, so that I can
look back in the table to see when each client was last contacted.
Any help is greatly appreciated
cheers

Set the default value of the date field's text box to "=Date()"

HTH - Keith.
www.keithwilby.com
 
Douglas J. Steele said:
Put logic in the form's BeforeUpdate event. Something like:

Private Sub Form_BeforeUpdate(Cancel As Integer)

Me!LastUpdated = Now()


So Me!LastUpdated is the table and field?
Silly question but would this be correct:
Lead_Responses!Date_of_Last_update = Date()
 
Nick said:
So Me!LastUpdated is the table and field?
Silly question but would this be correct:
Lead_Responses!Date_of_Last_update = Date()

No, Me refers to the form in which the code is running. LastUpdated is
either a control on that form, or a field in the form's underlying
recordset. If your field is named "Date_of_Last_update", use

Private Sub Form_BeforeUpdate(Cancel As Integer)

Me!Date_of_Last_update = Date()

End Sub
 
Back
Top