Counting records in a list box

Pauldohert

Something in here
Local time
Today, 05:29
Joined
Apr 6, 2004
Messages
2,101
I am opening a unbound form and populating a list box with a query.

If the query returns no records - I don't want the form to open.

My question is - which is the quickest way to count the records

If i use a dCount on my query does this take the same amount of time as re-running the query ( the query looks at a table with 10s of thousands of records and does a like search in a text field of 25 charcters) - so i really don't want to run it twice.

Or would counting the items in the listbox be better - Me.ListOrgs.ListCount

Or some other way

Thanks for the help. Paul
 
I would think running it at the query would be faster!
 
Crash1hd said:
I would think running it at the query would be faster!

Could you please elaborate - is this a third option - if so exactly what to I do - or are you recommending the Dcount


Thanks Paul
 
I would stop it at the query as you where saying with the dcount in the query cause if you do it at the form I would assume that it would have to run the query then stop it where if you did it at the query it would start to run the query relise there is nothing and stop it before it gets to the form!
 

Users who are viewing this thread

Back
Top Bottom