Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Checking to see if recordset is empty 1

Status
Not open for further replies.

Smoothcat74

Technical User
Aug 29, 2008
40
Hi all,

I have some code that needs to skip to a certain line if a recordset contains no information. Is there a simple command to check if a table has any information written to it or not? I tried the .recordcount property, but since it checks for records accessed it isn't returning a 0 or null value that I can work with.

Any help would be greatly appreciated! Thanks :)
 
how about
Dim Mydb as database
dim RST as recordset
Set Mydb =currentdb
Set rst = mydb.openrecordset("Select .... from ...")
If not rst.bof then
' Recorset has records
do something
end if





 
Worked like a charm. I just had to add a .requery line in front of it to make the #DELETED records were cleaned up. Thanks very much!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top