P
Paul Ponzelli
I would like to count the number of records in an append query using VBA
without running the append query. That is, I would like to obtain a count
of the number of records that an append query WOULD append to the
destination table before deciding whether to actually append the records.
I tried using the RecordCount property of the Recordset object, but it seems
you first have to open the recordset in ADO before you obtain a record
count. But since I don't want to run the append query at this point in the
code, I don't want to open the query.
I don't think I can use Dcount() either, because I'm going to be looping
through a number of queries (specified as field values in in a table), and
not all the append queries have the same field names, so I don't know what
value to put in the first argument (the field name) of the Dcount()
function.
How can I get a count of the number of records as I loop through a number of
append queries?
Thanks in advance,
Paul
without running the append query. That is, I would like to obtain a count
of the number of records that an append query WOULD append to the
destination table before deciding whether to actually append the records.
I tried using the RecordCount property of the Recordset object, but it seems
you first have to open the recordset in ADO before you obtain a record
count. But since I don't want to run the append query at this point in the
code, I don't want to open the query.
I don't think I can use Dcount() either, because I'm going to be looping
through a number of queries (specified as field values in in a table), and
not all the append queries have the same field names, so I don't know what
value to put in the first argument (the field name) of the Dcount()
function.
How can I get a count of the number of records as I loop through a number of
append queries?
Thanks in advance,
Paul