Hi, I have the following SQL Statment in VBA that is coming up with the debugger (image below)
Code:
Dim varItm As Variant
Set dbs = CurrentDb
Dim sSQL As String
sSQL = "INSERT INTO tblRosterRec ( Name, Date_, FctnID, EmpId ) " & _
"SELECT qryAllocated.Name, tbl36hrWeekRosters.Date_, tblFunctions.ReliefCode, qryAllocated.EmpId " & _
"FROM tbl36hrWeekRosters, qryAllocated INNER JOIN tblFunctions ON qryAllocated.FctnDesc = tblFunctions.FctnDesc " & _
"WHERE tbl36hrWeekRosters.Date_ = " & Me.txtDate & "" & _
"ORDER BY tblFunctions.ReliefCode;"
dbs.Execute (sSQL)

Can someone please tell me where I'm going wrong.
When I tried this query in the query builder it worked fine
but where I have changed it for vba something has gone wrong.