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 New unzip ZIP files including subfolders  The Enterprise Edition send emails to all users or just the users currently in the backend database file.

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-2009 Tony Toews