Display Date and Time in a form cell

  • Thread starter Thread starter Mike Green
  • Start date Start date
M

Mike Green

Hi all
I know that tis has been covered many times before but I am stuck and I
can't find any reference in my notes. I need to display the date and time
that a record is created in a form. I have a Date cell that records Date()
but in the form view and the report created from this data I would like it
to display the date and the time that the record was created. Any pointers
or advice on how to do this will be greatly appreciated.

Thanks in advance
 
Mike

If your field is named "Date", both you and Access will get confused (this
is a "reserved" word in Access -- change your fieldname to Updated or
DateChanged or ...).

You don't need to limit yourself to your notes to find earlier mentions.
Try using Google.com to search for them.

If you add a bit of code to your form's BeforeUpdate event, you can:

If Me.Dirty Then
Me!YourUpdateField = Date() **** or Now(), if you want
Date/Time****
End If

Good luck

Jeff Boyce
<Access MVP>
 
Thanks Jeff
The data cell on the database is actually called DateRecorded. I would like
it to show the date and the time that the record was created. I was sure
that I have used a relatively simple syntax in the past that would make the
cell in the form display 16/06/2005 11:19am. I was also hoping to show the
same in some of my printed reports that use the same data cell. Thanks for
your feed back
 
Mike

Now() returns date & time. How Access stores that is not relevant to what
you are trying to do. Formatting determines display (e.g., forms, reports).
 
PS "cells" are spreadsheet terminology -- Access doesn't have cells.

Jeff Boyce
<Access MVP>
 
Back
Top