Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

TimeOfDay

Posted on 2009-07-16
2
Medium Priority
?
217 Views
Last Modified: 2013-11-27
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.
0
Comment
Question by:Tim313
2 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 1000 total points
ID: 24869447


sql="Insert into tblTime ([Time]) Values (#" & timeValue(Now()) & "#)"
0
 

Author Closing Comment

by:Tim313
ID: 31604238
Thanks for the quick response and accurate solution!
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Explore the ways to Unlock VBA Project Password Excel 2010 & 2013 documents. Go through the article and perform the steps carefully to remove VBA Excel .xls file.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question