hi.
i'm trying to select some records for reporting purposes. i know i have more than 1 record that matches my selection criteria, but the recordcount is always 1.
My code looks like:
Dim Rs As DAO.Recordset
Set Rs = CurrentDb.OpenRecordset("SELECT * FROM [Client Info] WHERE [sgroup]=2", dbOpenDynaset)
Do While Not Rs.EOF
If Rs.EOF Then Exit Do
totalWL = Rs.RecordCount
exit do
'add logic to loop through and extract names.
Loop
Debug.Print totalWL
Set Rs = Nothing
Any suggestions?
i'm trying to select some records for reporting purposes. i know i have more than 1 record that matches my selection criteria, but the recordcount is always 1.
My code looks like:
Dim Rs As DAO.Recordset
Set Rs = CurrentDb.OpenRecordset("SELECT * FROM [Client Info] WHERE [sgroup]=2", dbOpenDynaset)
Do While Not Rs.EOF
If Rs.EOF Then Exit Do
totalWL = Rs.RecordCount
exit do
'add logic to loop through and extract names.
Loop
Debug.Print totalWL
Set Rs = Nothing
Any suggestions?