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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top