Solved

TimeOfDay

Posted on 2009-07-16
2
202 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) 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 Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

739 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