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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I ask if a Recordset has data?

Status
Not open for further replies.

sysr

Technical User
Aug 17, 2001
17
0
0
CA
How can I ask if a Recordset has data? (Also, should I be saying "populated"?)

10 sqlStringa = "SELECT OrganizationID FROM RegionalContracts WHERE Region=" & "'" & strSelectedRegion & "'"

20 Set ReportRS = Con.Execute (sqlStringa)

30 IF ReportRS(&quot;OrganizationID&quot;) <> &quot;&quot; THEN

Thank you!
 
The definitive method is:

if (ReportRS.BOF AND ReportRS.EOF) then.....

ie. the check is for nothing existing between BOF and EOF..

I use this exclusively to test for an empty recordset..#

JOhn.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top