ACC: Compile Errors Not Reported When Form Opened with Code
ID: Q121013
|
The information in this article applies to:
-
Microsoft Access versions 1.0, 1.1, 2.0
SYMPTOMS
Moderate: Requires basic macro, coding, and interoperability skills.
In Microsoft Access version 1.x, compile errors in procedures triggered by
the Open event are not reported if you use Access Basic code to open a form
in Dialog window mode.
In Microsoft Access version 2.0, compile errors in procedures triggered by
the Load event are not reported if you use Access Basic code to open a form
in any window mode.
RESOLUTION
Compile all your Access Basic code before you open the form.
STATUS
Microsoft has confirmed this to be a problem in Microsoft Access versions
1.0, 1.1, and 2.0. This problem no longer occurs in Microsoft Access
version 7.0.
MORE INFORMATIONSteps to Reproduce Problem
- Start Microsoft Access and open any database.
- Create a new module.
- From the Edit menu, choose New Procedure.
- In the New Procedure dialog box, select the Function option button,
and then type Force_Error in the Name box. Choose OK.
- Enter the following code in the module:
Function Force_Error()
MsgBox 1
End Function
- Save the module as Test and then close it.
- Create a blank new form. In Microsoft Access version 1.x, set the
form's OnOpen property to:
=Force_Error()
In Microsoft Access version 2.0, set the form's OnLoad property
to:
=Force_Error()
- Save the form as MyForm and then close it.
- Open the MyForm form in Form view. You will receive a compile error
message.
- Open the Test module, and then choose Immediate Window from the View
menu.
- Type the following line in the Immediate window and then press ENTER:
DoCmd OpenForm "MyForm",,,,,A_DIALOG
Note that you do not receive any error message.
Keywords : kberrmsg kbusage FmsEvnt
Version : 1.0 1.1 2.0
Platform : WINDOWS
Issue type : kbbug
|