fizzlesquirt
Technical User
I am trying to use a SQL insert statement to automatically add a record to a table to capture errors.
The table setup:
errRecordID - primary key, no duplicates, autonumber
Date - Date/Time
FormName - text
errorNumber - text
errorDescription - memo
Notes - memo
The code in VBA is as follows:
-----
---
The error I receive is:
Run-time error 3075
Syntax error (missing operator) in query expression "You can't go to the specified record')'.
I've been working on this for the last 3 hours without any success. All help is appreciated!
The table setup:
errRecordID - primary key, no duplicates, autonumber
Date - Date/Time
FormName - text
errorNumber - text
errorDescription - memo
Notes - memo
The code in VBA is as follows:
-----
Code:
Public Function errorCapture(frmName As String, errNum As String, errDesc As String)
MsgBox "An error has occured" & vbNewLine _
& "Form: " & frmName & vbNewLine _
& "Error: " & errNum & vbNewLine _
& errDesc & vbNewLine & vbNewLine _
& "This info has been added to the errors table", vbCritical _
, "Error"
Dim mySQL As String
mySQL = "INSERT INTO tblErrors (FormName, ErrorNumber, ErrorDescription) VALUES (" & "'" & frmName & "', " & "'" & errNum & "', " & "'" & errDesc & "' )"
Debug.Print mySQL
DoCmd.RunSQL mySQL
End Function
The error I receive is:
Run-time error 3075
Syntax error (missing operator) in query expression "You can't go to the specified record')'.
I've been working on this for the last 3 hours without any success. All help is appreciated!