Timestamp VBA

crashnburn99

Registered User.
Local time
Yesterday, 22:37
Joined
Jan 16, 2013
Messages
48
Hello all,

I am trying to create a time clock for my small business. I have the tables and forms developed but I am getting snagged on the coding portion. I currently have four buttons on my form, clockinbtn, clockoutbtn, lunchinbtn, lunchoutbtn. I want it to record the date and time to their related fields in my timetable. I tried doing this with macros but read a lot of post stating that VBA is the better choice. Unfortunately for me I do not know VBA very well. Any help would be greatly appreciated. Not sure what specific information would help but I will be more than happy to post any additional info if needed. Thank you again.
 
The code is fairly simple:

Me.NameOfTextbox = Now()
 
Thank you very much pbaldy for your response. My current form setup is one text box with your code, this displays the clock, then I also have four buttons; clockinbtn, clockoutbtn, lunchoutbtn, lunchinbtn. I also have a table with 5 fields; ID, Clock In, Clock Out, Lunch In, Lunch Out. I can't figure out how to make it where a user clicks the "clockinbtn" button and the time is recorded in the "Clock In" field on my table.
 
If the form is bound to the table, that code will do it. That's actually what I was thinking you were looking for.
 
I got it working with the help of pbaldy. I set my data source as my timetable and entered in, Me.TimeIn = Now(), now everything works great. Sorry for being such a pain pbaldy, but I cannot thank you enough for your help!!
 
Last edited:
No problem, happy to help.
 

Users who are viewing this thread

Back
Top Bottom