Currentdb.RecordsAffected Property in Microsoft Access

(Created 2010-09-27)

Access help states "Returns the number of records affected by the most recently invoked Execute method."

However this doesn't work using currentdb.  Each usage of currentdb is a new instance of the current database. Instead you must use an explicitly defined database.

That is use

Dim db as database
db.execute "<some sql>", dbfailon error
CountOfRecords = db.recordsaffected

and not

Currentdb.execute "<some sql>", dbfailon error
CountOfRecords = Currentdb.recordsaffected

[ Access | Main | Search ]

Auto FE Updater   Auto FE Updater distribute new and updated Front End databases to your users with several mouse clicks.

Wrench and gear Granite Fleet Manager - the best designed fleet maintenance tracking and management system available

Comments email Tony  Search Contact Tony's Blog Privacy Policy Table of Contents

Website copyright 1995-2013 Tony Toews