Hi,
Small follow up question. How would i change this command if i wanted to add more criteria linked to a different cell? (and where...)
Specifically I have some code that works that thanks to this forum I was able to create that looks like this
Code
cnPubs.Open strConn
Dim rsPubs As ADODB.Recordset
Set rsPubs = New ADODB.Recordset
With rsPubs
.ActiveConnection = cnPubs
For counter = 1 To 300
[B].Open "SELECT * FROM organization where organization.organizationid = " & Sheets("SQL").Range("b" & counter).Value[/B]
Sheets("SQL").Range("E" & counter).CopyFromRecordset rsPubs
.Close
Next counter
End With
cnPubs.Close
Set rsPubs = Nothing
Set cnPubs = Nothing
Display More
...but when i try to add another criteria linked to a cell such as
Code
.Open "SELECT * FROM organization where organization.organizationid = " & Sheets("SQL").Range("b" & counter).Value[B] and organization.docclauseid = " & Sheets("SQL").Range("c" & counter).Value
[/B]
i obviously can't get the right command figured out
Thanks so much