harry96794
New Member
- Joined
- Aug 2, 2012
- Messages
- 1
I am trying to ADODB to obtain a recordset whereby I select records with the following select statement:
.Open "SELECT STORE , CASESSTANDARD , CASES9LTR , PCODE , SALE, SDATE FROM " & TableName & " WHERE [STORE] = " & CStr(wsi.Cells(3, 6).Text) & " AND [PCODE] = '" & wsi.Range("A:A").Value & "'", cn, , , adCmdText
This code works perfectly fine up to the & " AND [PCODE] and on portion.
I am trying to select records from an access db where the PCODE field only pulls in records whereby pcode is one of the codes listed on my wsi sheet in column A.
Any way to do this?
.Open "SELECT STORE , CASESSTANDARD , CASES9LTR , PCODE , SALE, SDATE FROM " & TableName & " WHERE [STORE] = " & CStr(wsi.Cells(3, 6).Text) & " AND [PCODE] = '" & wsi.Range("A:A").Value & "'", cn, , , adCmdText
This code works perfectly fine up to the & " AND [PCODE] and on portion.
I am trying to select records from an access db where the PCODE field only pulls in records whereby pcode is one of the codes listed on my wsi sheet in column A.
Any way to do this?