Date Time Stamp on 2 separate fields when updated

lmac

Board Regular
Joined
May 12, 2005
Messages
103
I'm trying to add a date time stamp to two separate fields on my form. One field is where user enters their Start Time and the other field is where user enters their End Time. I've added 2 text boxes, StartSystemDateTimeLogged and EndSystemDateTimeLogged that I want the system date & time entered automatically when the user enters their Start Time and End Time. I've searched the forum and tried to use every suggestion I found but I can't get this to work. I have all four fields from the form in the same table and the StartSystemDateTimeLogged & EndSystemDateTimeLogged fields are hidden on the form so the user cannot see them. Any suggestions on how to make this work?
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Hi

If you go into the form design, right click the start time box (that the user inputs the time into), click Properties -> Event Tab -> After Update -> click the 3 dots to the right -> Code Builder -> then enter the following between the Private Sub... and End Sub lines :

Me.StartSystemDateTimeLogged = Format(Now(), "General Date")

This will insert the current date and time into the field 'StartSystemDateTimeLogged' - I have assumed the format for this field in the table is 'General Date'. Save and close the VBA editor.

Repeat for the other input box but remember to change the field name.

HTH, Andrew :)
 
Upvote 0
I promise I did this before but it gave me an error msg like "StartSystemDateTimeLogged macro cannot be found". I'll try it again.
 
Upvote 0
If you try this step by step the way I explained it, then it should work provided you use the correct field name. There shouldn't be any refernces to macros.
Andrew :)
 
Upvote 0
Thanks so much andrew. I tried it again & the problem was I added the StartSystem... & EndSystem text boxes to the form instead of adding them from the field list and forgot to change the text box names from Text49 & Text50 to the field names. That's where the problem was. It's working fine now.
 
Upvote 0

Forum statistics

Threads
1,214,965
Messages
6,122,499
Members
449,089
Latest member
Raviguru

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top