Solved Syntax Error - Brain Fart

NearImpossible

Registered User.
Local time
Yesterday, 22:10
Joined
Jul 12, 2019
Messages
225
Having a brain fart and can't seem to figure this one out, please point out the obvious that I am missing :)

my code is erroring with "Run-Time error '3075': Syntax error (missing operator) in query expression "InvoiceDetailID='23".

Code:
Dim rs As Recordset
Dim s As String

Set rs = CurrentDb.OpenRecordset("Select * from [dbo_FacilityInvoiceEquipment] Where 'InvoiceDetailID ='" & Me.InvoiceDetailID & "'", dbOpenDynaset, dbSeeChanges)
 
Numbers do not have single quotes. :(
 
Numbers do not have single quotes. :(
i knew it was something simple, I had no single quotes originally and had an extra double quote at the end that was killing me, always the little things......

Thanks again for your assistance !!
 
Last edited:
Put the sql string into a string variable. Then you can debug.print it, until you get it correct. Then you can use that in place of the actual string.
 

Users who are viewing this thread

Back
Top Bottom