Automatic date and time in excel or access

  • Thread starter Thread starter Jayj200
  • Start date Start date
J

Jayj200

Guest
How can I create a database which automaically inputs the date and time when a value is placed it another collumn.

e.g 3 collumns= name, date + time

When the name is inputted the present date and time are assigned to the name.

If the name is changed then the date and time are updated to the present.

Many Thanks.

J
 
In an Access table, you can use a default value for the date/time field so that when a new record is created by adding the "Name", the default value is also added.

If you want this to happen when updating an existing record, of course, the process is a bit more complex. You can add code to the "After_Update" event of the control on a form where you enter the "Name" so that it inserts the date. Because you state that your business rules call for an update to the date/time whenever the "Name" changes, that is all you really need.

Also, on a slightly different note, "NAME" , "DATE" and "TIME" are reserved words in Access and you should never actually use them as the names of fields in a table or of controls on forms or reports.

Excel has similar functions, I'm sure, but that's not my area of competence.

HTH
George
 
Last edited:
The command in excel is =now()
You then use the cell properties to dictate how you want it, ie just date or date&time etc.

However Excel is always live, so unlike access that can record the date/time at a set point excel is always live, so every time you open or update the sheet the date will change to the current time/date
 

Users who are viewing this thread

Back
Top Bottom