I am trying to set a variable in VBA equal to the number of records in a Query. Do you have to open the Query and use a command like NumRecords = rs.RecordCount, or is there a shortcut that does not require that the Query be opened?
For example: Nz(DSum("Field1", Query(i))) seems to work fine for aggregating the totals in Field1 without actually opening Query(i). Query(i) is just a string variable that equals the name of an existing Query. Is there a simliar command for just counting the number of records in a Query or Table?
Thank you for any help.
Jim
For example: Nz(DSum("Field1", Query(i))) seems to work fine for aggregating the totals in Field1 without actually opening Query(i). Query(i) is just a string variable that equals the name of an existing Query. Is there a simliar command for just counting the number of records in a Query or Table?
Thank you for any help.
Jim