How many records affected by query?


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
 
Ad

Advertisements

C

Crystal

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
 
Ad

Advertisements

Joined
Feb 28, 2012
Messages
2
Reaction score
0
Hi i am using the same code but i am getting the ODBC call failed error. can any one help me why am i getting this error.

Thank you in advance for your help.

-Dileep
 

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

Top