Color scheme: Riviera
You are here: start » en » Documentation » Microsoft Access development tools » WKL Forms Object Library » WKL Forms Object Library troubleshooting » Access stops responding after a delete or an error

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 WklGrid confirmation (“Do you want to delete 3 records?”) when records are deleted with the Delete key, the shortcut menu, or DeleteSelected. 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. WklTreeList and WklGantt ask in the same way.
  • The VBA error dialog box for an unhandled run-time error in an event procedure (for example, in BeforeDelete, in the Action of a WklToast, or in a function named in ActionFunction), 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

  1. 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 #32770 in the Access process.
  2. For deletions that code runs, or that run without a user, suppress the confirmation: handle BeforeDelete and set Confirm to False (and ask your own question there if needed), or set Cancel.
  3. 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.
  4. Compile the database (Debug › Compile) before it runs unattended.
en/wiki/msaccess/comctl/troubleshooting/access-waits-on-a-hidden-dialog.txt · Last modified: by Wolfgang van der Stille