Link to home
Start Free TrialLog in
Avatar of Snow-Storm
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`,`STATE`,`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
ASKER CERTIFIED SOLUTION
Avatar of jkaios
jkaios
Flag of Marshall Islands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of AsifBangash
AsifBangash

try to Jkaios commnts.