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)
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)