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

how to test wether or not a query returns a record 1

Status
Not open for further replies.

benwah

Technical User
Jun 27, 2001
97
GB
Hi

I want to run a query from VBA code and detect if it returns a record. So all i want to know is Yes it does return a record or No it doesnt return a record.

Is this possible?

cheers
wah
 
Yep, I do it all the time.

Dim reccnt as integer
RecCnt = DCount("KeyField",Queryname)
If RecCnt > 0 then
'you got records
Else
'you don't
End If Maq B-)
<insert witty signature here>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top