Microsoft KB Archive/210526

= ACC2000: Form Is Inaccessible When Debugging Run-Time Error =

Article ID: 210526

Article Last Modified on 6/24/2004

-

APPLIES TO


 * Microsoft Access 2000 Standard Edition

-



This article was previously published under Q210526



Moderate: Requires basic macro, coding, and interoperability skills.



SYMPTOMS
If a form calls a Visual Basic for Applications function that is halted because a run-time error occurred, you will not be able to access the form.



CAUSE
When a program halts because of a run-time error, the form's handle is not released by the system. Even though the program is no longer running, the handle is still in use.



RESOLUTION
To release the form handle after the program has halted, click Reset on the module's Run menu.



Steps to Reproduce Behavior
  Create and save a form with the following command button:   Object: Command Button --  Caption: Run Code OnClick: =Test   In a new module, create and save the following function named Test: Function Test Dim x as Integer x = 1 / 0 End Function  Open the form that you created in step 1. Click the Run Code button. Note that the program will halt and that you receive the error message "Division by zero." Click Debug.</li> Minimize the Visual Basic Editor.</li> Try to click the Run Code button again, or try to move the form. Note that you cannot manipulate the form or anything on it. This is because the form handle is not available.</li> To release the form handle after the program has halted, click Reset on the module's Run menu.</li></ol>

Additional query words: prb

Keywords: kbprogramming kbprb KB210526

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.