Snow-Storm
asked on
Access Database
Could someone tell me why this wont work? Thanks
It works with the first select statement, but it never selects anything with the second one.
Set rsADO = New ADODB.Recordset
rsADO.Open "SELECT `Client#` FROM JobFile WHERE `Invoice#`=" & Val(txtID.Text), conn
Set rsADO1 = New ADODB.Recordset
With rsADO
Do Until .EOF
For i = 0 To .Fields.Count - 1
rsADO1.Open "SELECT `MailAddr`,`MailCity`,`STA TE`,`Zip` FROM MAILING WHERE `Client#`=" & Val(.Fields(i).Value), conn
With rsADO1
Do Until .EOF
For j = 0 To .Fields.Count - 1
Print .Fields(j).Value
Next j
.MoveNext
Loop
End With
Next i
.MoveNext
Loop
End With
It works with the first select statement, but it never selects anything with the second one.
Set rsADO = New ADODB.Recordset
rsADO.Open "SELECT `Client#` FROM JobFile WHERE `Invoice#`=" & Val(txtID.Text), conn
Set rsADO1 = New ADODB.Recordset
With rsADO
Do Until .EOF
For i = 0 To .Fields.Count - 1
rsADO1.Open "SELECT `MailAddr`,`MailCity`,`STA
With rsADO1
Do Until .EOF
For j = 0 To .Fields.Count - 1
Print .Fields(j).Value
Next j
.MoveNext
Loop
End With
Next i
.MoveNext
Loop
End With
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
try to Jkaios commnts.