Hi All,
I haven't had an opportunity to work in Access for a few years and am rusty beyond belief. :banghead:
I am trying to insert a date from a unbound textbox in a form to a table. Both the textbox and the table field are set to shortdate format. I've confirmed that everything else works if I take the date out so I have only posted the variables for the date.
Dim itxtDate As Date
itxtDate = Me.txtDate
strSQL = "INSERT INTO tblMasterTrainingCourses (Trainer1, Trainer2, Application, EpicClass, Location, EnrollNumber, StartTime, EndTime, CapstoneCourse, Date) " & _
"VALUES ('" & icmbCT1 & "','" & icmbCT2 & "','" & icmbApp & "','" & icmbClass & "','" & icmbLoc & "','" & itxtEnrollNum & "','" & itxtStart & "','" & itxtEnd & "','" & itxtCapstone & "', #" & itxtDate & "#);"
DoCmd.RunSQL strSQL
Any help would be greatly appreciated.
Thanks, Mel
I haven't had an opportunity to work in Access for a few years and am rusty beyond belief. :banghead:
I am trying to insert a date from a unbound textbox in a form to a table. Both the textbox and the table field are set to shortdate format. I've confirmed that everything else works if I take the date out so I have only posted the variables for the date.
Dim itxtDate As Date
itxtDate = Me.txtDate
strSQL = "INSERT INTO tblMasterTrainingCourses (Trainer1, Trainer2, Application, EpicClass, Location, EnrollNumber, StartTime, EndTime, CapstoneCourse, Date) " & _
"VALUES ('" & icmbCT1 & "','" & icmbCT2 & "','" & icmbApp & "','" & icmbClass & "','" & icmbLoc & "','" & itxtEnrollNum & "','" & itxtStart & "','" & itxtEnd & "','" & itxtCapstone & "', #" & itxtDate & "#);"
DoCmd.RunSQL strSQL
Any help would be greatly appreciated.
Thanks, Mel