I am recieving the following run time error when I click the 'Owned?' check box on my form.
Run-time error '3142':
Characters Found After End of SQL Statement
When I debug, this is what it highlights:
Which is part of this code string:
I have searched around a bit and found that an ';' might cause this error as it will stop an SQL statement, but the only ';' is at the end and taking it out only errors the database again with an expected ';' message.
Any help would be appreciated.
KJL
Run-time error '3142':
Characters Found After End of SQL Statement
When I debug, this is what it highlights:
Code:
dbs.Execute strSQL, dbFailOnError
Which is part of this code string:
Code:
Private Sub Owned__AfterUpdate()
If Me![Owned?] = -1 Then 'Checks that item was selected
Dim dbs As DAO.Database
Set dbs = CurrentDb
Dim strSQL As String
strSQL = "INSERT INTO tblPersonalCollection (Description, CardNumber, CarNameID, SeriesID, YearID) " & "Values (Me!MstrDescription, Me!MstrCardNumber, Me!MstrCarName, Me!MstrSeriesName, Me!MstrProdYear);” "
dbs.Execute strSQL, dbFailOnError
Else
Exit Sub 'Exits sub if item wasn't selected
End If
End Sub
I have searched around a bit and found that an ';' might cause this error as it will stop an SQL statement, but the only ';' is at the end and taking it out only errors the database again with an expected ';' message.
Any help would be appreciated.
KJL