ACC2: Dialog Form Is Not Modal When DefaultEditing Is Set

ID: Q128255


The information in this article applies to:


SYMPTOMS

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

When you open a form as a dialog form by setting the OpenForm action's Window Mode argument to Dialog, the form is not modal as you expect.


CAUSE

The form contains code in its Open or Load event that modifies the DefaultEditing property.


STATUS

Microsoft has confirmed this to be a problem in Microsoft Access version 2.0. This problem no longer occurs in Microsoft Access version 7.0.


MORE INFORMATION

Steps to Reproduce Problem


  1. Open the sample database NWIND.MDB.


  2. Open the Employees form in Design view.


  3. From the View menu, select Properties, and then set the OnOpen property (or OnLoad property) to the following event procedure:
    
          Sub Form_Open (Cancel As Integer)
                Me.DefaultEditing = 3   ' Read-only
          End Sub 


  4. Open the Utility Functions module in Design view, and then choose Immediate Window from the View menu.


  5. Type the following line in the Immediate window

    DoCmd OpenForm "Employees",,,,,A_DIALOG

    and press ENTER. Note that the Employees form opens read-only, but that it is not modal; you can select other forms or the Database window.



Keywords          : kbusage FmsProp 
Version           : 2.0
Platform          : WINDOWS 
Issue type        : kbbug 

Last Reviewed: April 9, 1999