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

How to tell if this query returns no results..

Status
Not open for further replies.

nonturbo

IS-IT--Management
Aug 27, 2001
78
US
OK, I've got the following Query hardcoded into my VBA, and it works beautifully, with one exception: if the query returns no results, Access crashes! Is there an if statement I can use to say (in pseudocode) if IsNull QueryResults, do this, else do that..

Anywho, heres the query (doubt it even matters)...


afilter = "Year = " & y & " and Period = " & p
Set BrokerActivity = MyDatabase.OpenRecordset("select * from BrokerData where " & afilter)
BrokerActivity.MoveFirst


TIA for any quick help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top