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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top