You use QueryDef to create/edit a
Query Definition, not execute a query (open a recordset).
This is how you open a recordset
dim rec as DAO.Recordset
dim lngRecCount as Long
set rec = Currentdb.Openrecordset("MyQueryName")
'Check to see if records exist
If rec.RecordCount < 1 then ' then are records
' no records
do somthing here
end if
or to use you methed use:
rec.MoveLast ' this updates the record count
lngRecCount = rec.RecordCount
Boyd
"Hi Tech Coach"
Access Based Accounting/Business Solutions developer.
http://www.officeprogramming.com