How to count the # of records in a query?

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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
 
Back
Top