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

Counting records in an already made query 1

Status
Not open for further replies.

daveonion

Programmer
Aug 21, 2002
359
GB
Hi I have a query that has already been created and i want to count the amount of records in that query, whats the easiest way to do it,

I thought i could do

x = CurrentDb.QueryDefs("myquery").recordcount

but evidently i cant, any help as always appreciated
thanks
 
My approach would be to create a RecordSet with the predefined Query or Create a RecordSet with a Select Count(*) against the predefined query. hthw,

Steve Medvid
"IT Consultant & Web Master"

Chester County, PA Residents
Please Show Your Support...
 
Another way:
x = DCount("*", "myquery")

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Hi I was using Dcount originally, but hadnt thought of putting * there, thanks the * is worth a *, how corny is that :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top