J
jsccorps
I have two OpenRecordsets that work fine separately. When I try to AND them
together I get the following message: "... syntax error (missing operator)
in query expression ...". The two OpenRecordsets are below, followed by the
flawed OpenRecordset with the And:
Set rs = CurrentDb.OpenRecordset("Select * From [AgentDataBase] Where
[Manager #]=" & [Manager], dbOpenDynaset) ' works fine
Set rs = CurrentDb.OpenRecordset("Select * From [AgentDataBase] Where [Agent
Name]= '" & AgtName & "'", dbOpenDynaset) ' works fine
Set rs = CurrentDb.OpenRecordset("Select * From [AgentDataBase] Where
([Manager #]= & [Manager] and [Agent Name]= '" & AgtName & "'",
dbOpenDynaset) ' results in syntax error
together I get the following message: "... syntax error (missing operator)
in query expression ...". The two OpenRecordsets are below, followed by the
flawed OpenRecordset with the And:
Set rs = CurrentDb.OpenRecordset("Select * From [AgentDataBase] Where
[Manager #]=" & [Manager], dbOpenDynaset) ' works fine
Set rs = CurrentDb.OpenRecordset("Select * From [AgentDataBase] Where [Agent
Name]= '" & AgtName & "'", dbOpenDynaset) ' works fine
Set rs = CurrentDb.OpenRecordset("Select * From [AgentDataBase] Where
([Manager #]= & [Manager] and [Agent Name]= '" & AgtName & "'",
dbOpenDynaset) ' results in syntax error