Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Issue Inserting a Time using Insert Into 2

Status
Not open for further replies.

nobull613

Technical User
Jun 6, 2003
76
US
I'm trying to insert a date, start time and end time that is entered in a form. I keep getting an error stating that there is a sytax error at the Me.Mon_Start location.

DoCmd.RunSQL "INSERT INTO Table1 (Float_Date, Start_Date, End_Date) VALUES (#" & dtCurr & "# , " & Me.Mon_Start & " , " & Me.Mon_End & " )"

dtCurr is a Date variable.

The destination fields for the times are Date/Time fields. The field in the form and table are short time fields. When the error appears it shows the value as 8:00:00 AM.
 
Perhaps this ?
DoCmd.RunSQL "INSERT INTO Table1 (Float_Date, Start_Date, End_Date) VALUES (#" & dtCurr & "#,#" & Me.Mon_Start & "#,#" & Me.Mon_End & "#)"

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Perfect. Thank you. I didn't realize the # was used around times as well as dates.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top