Record Set Null

  • Thread starter Thread starter Sash
  • Start date Start date
S

Sash

I have a bunch of code that runs, but I want to prompt the user and not run
it if there are no records found.

Thought I could do something like, whereby rs is the recordset:

If IsNull(rs) Then
MsgBox "No Records Found"
db.Close
End If
 
assuming you have set a recordset you can use something like:

with rs
if not .BOF and not .EOF then
'do your stuff here
else
'if you get here there will be no records so put your cancellation here.
end if
end with

hth
 
Back
Top