receive returned value from doCmd.openquery

V

Van T. Dinh

OpenQuery Method simply opens the DatasheetView of your
Query.

If you want to "receive" the Count in code, you can use
the DCount() function. BTW, you can use DCount() directly
on the Table and therefore, you don't need the Query,
either. Something like:

DCount("*", "t1", "[CustID] = 123")

(assuming [CustID] in numeric)

Alternatively, you can create a Recordset and then get the
RecordCount of the Recordset. This requires a few more
lines of code so I prefer to use DCount().

Check Access VB Help on the DCount() function.

HTH
Van T. Dinh
MVP (Access)
 

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