Ok, Im really tired banging my head on the monitor over the correct syntax for this one. Im trying to add a record to an Access database and I receive the following error;
Syntax error (missing operator) in query expression 8:00:00 AM.
Here is the associated SQL statement Im using;
datEventDate = CDate(txtDate.Text)
datStart = CDate(txtStart.Text)
datEnd = CDate(txtEnd.Text)
datToday = DateTime.Today
Dim strCmd As String
strCmd = "INSERT INTO tblEvent (AdminName, AdminDate, Event, EventDate, StartTime, EndTime, Location, Childcare, AddDetail) VALUES (" & strAdmin & ", " & datToday & ", " & txtEvent.Text & ", " & datEventDate & ", " & datStart & ", " & datEnd & ", " & lstLocation.SelectedValue & ", " & strChildcare & ", " & txtComments.Text & ")"
Here is the data Im attempting to add;
AdminName = determined in application
AdminDate = determined in application
Event = Test event
EventDate = 04/09/2005
StartTime = 08:00
EndTime = 21:00
Location = Other
Childcare = False
AddDetail = Its my birthday
Thanks for taking the time to help.
Tate
Syntax error (missing operator) in query expression 8:00:00 AM.
Here is the associated SQL statement Im using;
datEventDate = CDate(txtDate.Text)
datStart = CDate(txtStart.Text)
datEnd = CDate(txtEnd.Text)
datToday = DateTime.Today
Dim strCmd As String
strCmd = "INSERT INTO tblEvent (AdminName, AdminDate, Event, EventDate, StartTime, EndTime, Location, Childcare, AddDetail) VALUES (" & strAdmin & ", " & datToday & ", " & txtEvent.Text & ", " & datEventDate & ", " & datStart & ", " & datEnd & ", " & lstLocation.SelectedValue & ", " & strChildcare & ", " & txtComments.Text & ")"
Here is the data Im attempting to add;
AdminName = determined in application
AdminDate = determined in application
Event = Test event
EventDate = 04/09/2005
StartTime = 08:00
EndTime = 21:00
Location = Other
Childcare = False
AddDetail = Its my birthday
Thanks for taking the time to help.
Tate