How to count the # of records in a query?

G

Guest

Hello everyone

My task is to query a table in a VBA function and then return the count to
the calling environment.

How do I do that inside the function?

The profile of the function is something like this:

function CountItems ( strSQL as String) as integer

Many thanks
 
T

tina

take a look at the DCount() function in Access Help, you can use it on a
saved query object the same as you can on a table.

hth
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top