Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

simulate timestamp 1

Status
Not open for further replies.

zyrag

IS-IT--Management
Dec 4, 2002
252
0
0
PH
i want MS access to save the timestamp into a date/time field on my table everytime a transaction is entered. how do i achieve this without coding through macro?
 
Hi Zyrag

There are lots of ways to crack this nut. The quickest may be the following

In the field definition within the table design set the default value to =Now()

As new records are added to the table the date stamp will be automatically set.

Hope this helps
 
Zyrag - There are many ways to do this, the simplest way would be to set up a form which based on the table with a text box which automatically enters the current date when you exit the last field of your table. (You would need to add a field called Timestamp to your table).

Set up a form based on the table and enter the following code into the On Lost Focus event of the last field:

Code:
Private Sub LAST_FIELD_LostFocus()
Dim cur_date as date


cur_date=Date
[TimeStamp].Value=cur_date
End Sub

You could lock this field or even make it invisible



 
thanks to both of you guys. you both have great ideas but Ian's way solved much of my requirements. I wasn't able to mention that i'm using vb6 as the front-end, but trystan's way also works great.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top