Solved

TimeOfDay

Posted on 2009-07-16
2
181 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 119

Accepted Solution

by:
Rey Obrero earned 250 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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

758 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now