romeerome368
Programmer
Hello,
I have a database where I am creating a recordset to pull a list of receipents, and then generate an excel file with their own individual data as an attachment via VBA. The problem that I am running into is that I get an error message that states that it can't find my SQL statement.
Run-time error ‘3011’:
The Microsoft Jet database engine could not find the object ‘SELECT * FROM [tablename] WHERE [Fieldname] =’” & varFN & “’;”. Make sure the object exists and that you spell its name and the path name correctly.
strSQL = "SELECT * FROM [tablename] WHERE [FieldName] = '" & varFN & "';"
It seems as though my SQL statement is a valid one, but if I have forgotten something or my syntax is incorrect, please let me know.
Your assistance is greatly appreciated.
I have a database where I am creating a recordset to pull a list of receipents, and then generate an excel file with their own individual data as an attachment via VBA. The problem that I am running into is that I get an error message that states that it can't find my SQL statement.
Run-time error ‘3011’:
The Microsoft Jet database engine could not find the object ‘SELECT * FROM [tablename] WHERE [Fieldname] =’” & varFN & “’;”. Make sure the object exists and that you spell its name and the path name correctly.
strSQL = "SELECT * FROM [tablename] WHERE [FieldName] = '" & varFN & "';"
It seems as though my SQL statement is a valid one, but if I have forgotten something or my syntax is incorrect, please let me know.
Your assistance is greatly appreciated.