TimeOfDay

I'm trying to use TimeOfDay in my code to enter the system time into a table (field "Time") each time the user enters a record.

My code (simplified):
Dim currentTime As Date
currentTime = TimeOfDay
sql="Insert into tblTime (Time) Values (" & currentTime & ")"

The actual dbconnection and sql statement worked until I added the "Time" field and " & currentTime &".

Is my reference to the varible correct?

Thanks in advance.
Tim313Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Rey Obrero (Capricorn1)Connect With a Mentor Commented:


sql="Insert into tblTime ([Time]) Values (#" & timeValue(Now()) & "#)"
0
 
Tim313Author Commented:
Thanks for the quick response and accurate solution!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.