Purdue2479
Registered User.
- Local time
- Today, 08:14
- Joined
- Jul 1, 2003
- Messages
- 52
I am getting a runtime error 3075, "Syntax error (missing operator) in query expression.", when the sql code below trys to execute. The '" & msgerror & "' piece is causing the issue and I don't understand why. I have declared msgerror as a String to store the error description. Any ideas?
This is the msgerror value "Field 'Start Date Month Disp' doesn't exist in destination table 'tbl_temp_Import_test.'"
Does it not like the single and double quotes within the string?
This is the msgerror value "Field 'Start Date Month Disp' doesn't exist in destination table 'tbl_temp_Import_test.'"
Does it not like the single and double quotes within the string?
Code:
If Err.number = 2391 Then
msgerror = Err.Description
'intresponse = MsgBox("Import Failed on " & ShortFn & " , click Ok to ignore file or Cancel to quit import",vbOKCancel)
DoCmd.RunSQL "INSERT INTO tbl_Failed_Import_Files ([Failed Files], [Field Name Causing Failure]) " & _
"Values('" & ShortFn & "','" & msgerror & "');"
Debug.Print ShortFn
Last edited: