Getting error 2342 a RunSQL statement requires and argument Consisting of a SQL stmt

bconner

Registered User.
Local time
Today, 09:42
Joined
Dec 22, 2008
Messages
183
Hi All,

I am getting error 2342 a RunSQL statement requires and argument Consisting of a SQL stmt when I try to run the below code. Basicall I am prompting the user using an InPutBox for a value then trying to run the query.

Any idea why this won't work?



Code:
strInPutBox = InputBox("Enter the NPI(s) to Retrieve TAX IDs")
    DoCmd.RunSQL "select * from SOAP_Incentivized_Worklist where [Prac NPI] = ('" & strInPutBox & "')"
 
RunSQL can only be used on action queries (append, update, delete, etc). Depending on what you're doing, you can use a recordset, DLookup() etc to get the value.
 
Thanks pbaldy, I appreciate your help...
 

Users who are viewing this thread

Back
Top Bottom