How do I check the query record count from a macro?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a macro that needs to do one thing if the number of records in a query
is >0, and something different if the number of records in the same query is
0. How do I tell the macro to check the record count of the query?
 
Use the DCount function in the Condition expression. See DCount info in Help
files.
 
1 - there is no help file from Access directly (without going into the
expression builder) on DCount
2 - that is a solution using VB - I need this to happen from a Macro - the
condition line to be exact - "How do I tell the MACRO to check the record
count of the query?" - we don't want to do this using VB
 
DCount information can be found in VBA Help under function list.

You can use VBA functions in macro conditions. The following will be true if
there is at least one record found:

Condition:
DCount("*", "TableOrQueryName", "[FieldName]=SomeValue") > 0
 
Back
Top