Looping

  • Thread starter Thread starter Allison
  • Start date Start date
A

Allison

Can you provide a reference book or guide using DAO code
for looping through a recordset and determining if there
are any errors.
 
Can you provide a reference book or guide using DAO code
for looping through a recordset and determining if there
are any errors.

strSQL = "SELECT IDNum FROM MyTable " & _
"WHERE SomethingWrong = TRUE " & _
"ORDER BY IDNum;"

Set rs = db.OpenRecordset(strSQL, dbOpenSnapshot, dbForwardOnly)

If rs.EOF Then
MsgBox "There are no errors"

Else
Debug.Print "These are the problem records:"
Do While Not rs.EOF
Debug.Print rs!IDNum
rs.MoveNext

Loop

End If


rs.Close


Hope that helps


Tim F
 
Back
Top