Access stops responding after a delete or an error
Environment
All controls, in an instance of Access that was started through Automation
(New Access.Application, CreateObject) or is hidden (Visible = False), and in an instance
whose window is behind other windows.
Cause
Access isn't hanging; it's waiting for a message box that nobody can see. There are two known kinds:
- The
WklGridconfirmation („Do you want to delete 3 records?“) when records are deleted with the Delete key, the shortcut menu, orDeleteSelected. It's a Windows message box (window class#32770, title „WKL Grid“) owned by the Access main window: when Access is hidden, the message box is hidden too, and Access waits for it.WklTreeListandWklGanttask in the same way. - The VBA error dialog box for an unhandled run-time error in an event procedure (for example, in
BeforeDelete, in theActionof aWklToast, or in a function named inActionFunction), and the dialog box for a compile error in a module.
Task Manager shows Access as „Not responding“ only while the dialog box is waiting; the CPU stays idle.
Resolution
- Make Access visible (
Application.Visible = True) or bring its window to the front to see the dialog box, or use a window inspection tool to look for a window of class#32770in the Access process. - For deletions that code runs, or that run without a user, suppress the confirmation: handle
BeforeDeleteand setConfirmto False (and ask your own question there if needed), or setCancel. - Give every event procedure, and every function a control calls, an error handler (
On Error GoTo ...), and write errors to a log or a table instead of leaving them to the VBA dialog box. - Compile the database (Debug › Compile) before it runs unattended.
Related topics
en/wiki/msaccess/comctl/troubleshooting/access-waits-on-a-hidden-dialog.txt · Zuletzt geändert: von Wolfgang van der Stille