datetime button

sdkramer

Registered User.
Local time
Today, 00:02
Joined
Mar 19, 2002
Messages
64
I've a button that I'd like to make put the current date and time in a date/time field I have in my table. It is the table associated with the form. But I just don't know how to do this. Any ideas. I'm thinking I'll have to use the Now() function, but I don't know how to put it in the table. Here's what I've tried

Private Sub cmdSubmit_Click()

tblTicket.StartTime = Now()

End Sub

I've also tried

tblTicket.StartTime.value = Now()

TIA,

Seth
 
You're on the right track. You actually do not need to specify the tablename if your table is the reccordsource for the form.

You can just use:
Me.StartTime=Now()
That will update your table directly.

If you have a field on your form that is bound to the StartTime field, then it will update that field, which will in turn update the table.

By the way, the "Me" keyword refers to the form that is running the code.
 
Thanks very much, very helpful.

:)
 

Users who are viewing this thread

Back
Top Bottom