I am trying to add error detailt to table with following code.
When report can't be exported it should add details like reportname, database and path to table and quit database.
But when code starts I get runtime error "3134", Syntax errot in INSERT INTO statement.
Where did I go wrong in my code?
When report can't be exported it should add details like reportname, database and path to table and quit database.
But when code starts I get runtime error "3134", Syntax errot in INSERT INTO statement.
Where did I go wrong in my code?
HTML:
Function Test()
Dim strDBName As String
Dim strDBPath As String
Dim strRptName As String
Dim str2SQL As String
strDBName = Application.CurrentProject.Name
strDBPath = Application.CurrentProject.Path
strRptName = "ReportName"
str2SQL = "INSERT INTO tblLog ([Log], [Database], [Path]) VALUES ('" & strRptName & "','" & strDBName & "','" & strDBPath & "');"
DoCmd.RunSQL str2SQL
DoCmd.QuitEnd Function