In the database I'm working on, the user has a daily log on a continuous form that encompasses some routine activities. For example at 6am every morning they report to work and at 4 4pm every evening they check out; at noon they eat lunch etc. I want to have a button that autopopulates the date time field with the current date and those specific times so they don't have to enter the routine stuff daily to save time. The field is "StartTime." It's a date/time field value in the table and the property sheet format is mm/dd/yy hhnn. I began the code as
But I keep getting the error "The value you entered isn't valid for this field."
Any help is appreciated! Thanks for having a look!
Code:
Private Sub MorningRoutine_Click()
DoCmd.GoToRecord,,acNewRec
Description = "Report to work"
StartTime = #" & Date & 0600"#"
DoCmd.GoToRecord,,acNewRec
Description = "Lunch break"
StartTime = #" & Date & 1200"#"
DoCmd.GoToRecord,,acNewRec
Description = "Cleanup and leave work"
StartTime = #" & Date & 1600"#"
End Sub
But I keep getting the error "The value you entered isn't valid for this field."
Any help is appreciated! Thanks for having a look!