How to Debug Access Append Queries Failing in Access Runtime
Question details
The user needs to debug an Access append query triggered by a VBA button event that executes successfully in the full version of Microsoft Access but fails when run in Access Runtime.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- Executing a VBA function via a button click to retrieve data from a SQL Server and append it to another table using Access Runtime.
- Observed behavior
- The append query fails to execute in Access Runtime, providing limited debugging feedback since the runtime environment lacks a design interface and code editor.
Since Access Runtime does not provide a design interface or built-in VBA debugger, ensure you have a backup of your database and access to the full version of Microsoft Access to modify your VBA code.
Isolate the Button Event and VBA Function
Use diagnostic message boxes to determine if the failure occurs during the button click event or deeper inside the SQL Server data fetching function.
Because Access Runtime lacks traditional debugging tools, you must manually trace the code execution path. The error could be caused by an unbound event, missing SQL permissions, or an unhandled VBA exception.
Open your form in Design View using the full version of Microsoft Access. Select the button, open the Property Sheet, and ensure that the 'On Click' property explicitly displays '[Event Procedure]' rather than being blank.
Open the VBA Editor. In your button's click event (e.g., btn_ok_Click), temporarily comment out the call to your append function (FetchData) by typing an apostrophe at the start of the line. Below it, type: MsgBox "Hello!"
Save and compile your database. Open the database using Access Runtime and click the button. If the "Hello!" message appears, your button event is working correctly, meaning the failure happens inside your FetchData function.
Return to the full version of Access, uncomment the FetchData call, and insert multiple MsgBox statements inside the FetchData procedure (e.g., before and after the SQL connection). Re-test in Runtime to see exactly which step fails.
If the code fails during data retrieval or appending, ensure the machine running Access Runtime has the correct ODBC drivers installed, valid connection strings, and proper user permissions for the linked SQL Server tables.

Looking for a reliable and lightweight Office alternative?
While WPS Office does not natively support Microsoft Access database files, it provides a powerful, highly compatible, and free suite for your Word, Excel, and PowerPoint documents. Enjoy a familiar interface and seamless migration for all your daily documentation needs.
- 1. Download WPS Office: Visit the official WPS website and download the free installation package for your operating system.
- 2. Install the Software: Run the installer and follow the on-screen instructions to complete the setup.
- 3. Open Your Documents: Launch WPS Office and instantly open, edit, and save your existing Word, Excel, and PowerPoint files.

Frequently Asked Questions
Why does my VBA code work in full Access but crash in Runtime?
Access Runtime lacks the design environment and VBA debugger. Unhandled errors that normally trigger the debugger in the full version will cause Runtime to silently fail, freeze, or abruptly close.
How can I view VBA error messages in Access Runtime?
By default, Access Runtime does not display standard VBA error dialogs. You must implement custom error handling in your code using 'On Error GoTo ErrorHandler' and use 'MsgBox Err.Description' to manually output the error details to the user.
Do SQL Server linked tables function differently in Access Runtime?
The linked tables themselves function identically. However, environmental factors on the machine running Runtime—such as missing ODBC drivers, different network configurations, or lack of trusted locations—often cause connection queries to fail.




