Creating SQL with recorset variable

GPSPOW

Registered User.
Local time
Today, 12:21
Joined
Apr 25, 2012
Messages
27
I have a SQL statement to create a query with a where condition coming from a recordset value.

When I process the following code, the variable name comes out as the actual value. I am attempting to qualify the query to the value from the recordset record the do while loop is currently at.

strSqlPhysSelect = "Select dbo_DMisProvider.ProviderID, dbo_DMisProvider.Name into tbl_IPA_Phys_Select " & _
"FROM dbo_DMisProvider " & _
" WHERE dbo_DMisProvider.ProviderID = " & rst!ProviderID &";"

Thanks

GPSPOW
 
Whats the question here? all you've said is what you doing
 
Please show us all the code involved. As SQL_Hell says, you haven't asked a question, so please do.
 
Not the same person, but a similar issue. I am new to VBA programming in Access and am trying to use a local (Access) table/recordset to a SQL Pass thru query.
Local Table: One column (Patient_IEN) as

Patient_IEN
7175551,
23613408104,
23613413153

SQL Pass Thru Sample:

Select
a.PATIENT_#02_IEN,
a.KEY_TIU_DOCUMENT_8925
From Vista.MDE.TIU_DOCUMENT_8925 a
Where a.PATIENT_#02_IEN in(Local recordset/Table)

Any help would be appreciated.
 

Users who are viewing this thread

Back
Top Bottom