I'm trying to run this code but it gives me the error message:
Run-time error '3075'; "Syntax error(missing operator) in query expression"
How should I fix this error?
I would like insert CellNumber that is in table1 but not in Variable table into ERROR table with DateTime, string, and CellNumber
Dim sqlstr As String
sqlstr = "SELECT CellNumber FROM table1 WHERE CellNumber NOT IN (SELECT CellNumber FROM Variable)"
DoCmd.RunSQL "INSERT INTO ERROR ([DateTime], RowNum, Error) SELECT Now(), 'string' as RowNum, CellNumber FROM(" & sqlstr & ")"