Records affected by running by docmd.openquery

  • Thread starter Thread starter lowestbass
  • Start date Start date
L

lowestbass

I am building a database with approximately 70 queries which I am
running from VBA. I have disabled messages, but I would like to
creae a log of the records that have been updated by each query. Is
there a way of finding out how many records are updated when using
"docmd.OpenQuery" and when using DoCmd.RunSQL.

Thank you in advance for your help.

Jeremy Lowe
 
Use Execute instead of RunSQL.

Example:
With dbEngine(0)(0)
.Execute "Query1", dbFailOnError
Debug.Print .RecordsAffected
End With
 
Back
Top