Returning the number of Appended records to a variable

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

Guest

I was wondering if it was possible to return the number of records from an append query into a variable. I have a query, which will first check that the record to be appended is unique in all its values. Once this has run, it then does a series of update queries. However, as these subsequent queries take considerable time to run. If I can return the number of records that are appended, then I can put in a simple check that will not run these subsequent queries and save a lot of time.
Any advice?
 
See RecordsAffected.

Example:

Dim db As DAO.Database
Set db = dbEngine(0)(0)
db.Execute "INSERT INTO ...
MsgBox "Number of new records: " & db.RecordsAffected
Set db = Nothing

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Dunk said:
I was wondering if it was possible to return the number of records from an
append query into a variable. I have a query, which will first check that
the record to be appended is unique in all its values. Once this has run, it
then does a series of update queries. However, as these subsequent queries
take considerable time to run. If I can return the number of records that
are appended, then I can put in a simple check that will not run these
subsequent queries and save a lot of time.
 
Back
Top