Automatic Date Entry

  • Thread starter Thread starter Stephen Brown
  • Start date Start date
S

Stephen Brown

I have two fields in a database one for recording brief
details of progress in completing a task (a text field)
and an associated field that records the date the
progress update details are entered ( a date field).

What I would like to know is whether there is anyway of
setting up the database so that the current date is
automatically entered into the date field when any data
is entered into the progress field?

Thanks

Stephen Brown
 
Stephen,

Add the following code to the progress textbox's AfterUpdate event:
If Len(Nz(Me!txtProgress, "")) > 0 Then
If Not IsDate(Me!txtDate) Then Me!txtDate = Date()
End If

This checks if the txtProgress textbox has anything in it, and if so, ads
the current date into the txtDate textbox, but only if it doesn't already
contain a valid date.

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
 
Thank you very much for that suggestion. I've tried it
and after a couple of false starts have got it to work.

Stephen Brown
 
Back
Top