Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 149
  • Last Modified:

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
0
Snow-Storm
Asked:
Snow-Storm
1 Solution
 
jkaiosIT DirectorCommented:
Try removing the single quotes (') from the "field list" -- MailAddr, MailCity, State, Zip

rsADO1.Open "SELECT MailAddr, MailCity, State, Zip FROM Mailing WHERE [Client#] = " & Val(.Fields(i).Value), conn
0
 
AsifBangashCommented:
try to Jkaios commnts.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now