Records affected by running by docmd.openquery

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
 
A

Allen Browne

Use Execute instead of RunSQL.

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