How many records affected by query?

  • Thread starter Thread starter OceansideDJ
  • Start date Start date
O

OceansideDJ

I have a button on a form that OnClick does DoCmd.OpenQuery...
I want to turn off the warnings, but still report the number of records updated
to the user. I am trying to use the RecordsAffected property with no luck so
far.

Thanks,

Mike
 
I think you need to use the db.Execute method with the
RecordsAffected property. Convert your SQL statement into
a string.

Dim db as DAO.Database
Dim strSQL as String

Set db = CurrentDb

strSQL = <sql statement goes here, converted to VBA>

db.Execute strSQL
MsgBox db.RecordsAffected

Hope this helps,
Crystal
 
Back
Top