General discussion

Locked

Time stamp on insertion of a record in A

By layland ·
How do you create automatic time stamp for when a record is inserted into a database in Access 2000? Is there a way?

This conversation is currently closed to new comments.

6 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Time stamp on insertion of a record in A

by Inspectorclave In reply to Time stamp on insertion o ...

There are several ways to do this. One way is to create a field that you want to store the time in (ex: xTimeStamp). In the table, specify the data type of the field as Date/Time and set the formatting for what you want (short time, long time, etc.). Next, add the field to the form, set the Enable attribute to No and the Locked attribute to Yes (this will prevent the field form being edited by the user). Create a command button and put the following code in the OnClick event:

Dim xDate as Date
xDate = Now
Me.xTimeStamp = xDate
DoCmd.GoToRecord , , acNewRec

Lastly, remove the Navigation Buttons from the form.

Collapse -

Time stamp on insertion of a record in A

by layland In reply to Time stamp on insertion o ...
Collapse -

Time stamp on insertion of a record in A

by kkenkel513 In reply to Time stamp on insertion o ...

Another way is to add a date/time field to the table and set the default value to Now() in the Design view. This will grab the time that the first character was typed into the new record. If you actually want the exact time the record was inserted, you'll have to use code as shown in the other answer.

Collapse -

Time stamp on insertion of a record in A

by layland In reply to Time stamp on insertion o ...
Collapse -

Time stamp on insertion of a record in A

by icapan In reply to Time stamp on insertion o ...

In table you put the field time, and on the defalut value put now(), adn chose the format which you wont, on form if you need to see or not need put the propritites visible yes or no

Collapse -

Time stamp on insertion of a record in A

by layland In reply to Time stamp on insertion o ...
Back to Software Forum
6 total posts (Page 1 of 1)  

Related Discussions

Related Forums