ACC2: Dialog Form Is Not Modal When DefaultEditing Is Set (128255)



The information in this article applies to:

  • Microsoft Access 2.0

This article was previously published under Q128255
Moderate: Requires basic macro, coding, and interoperability skills.

SYMPTOMS

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.

Modification Type:MajorLast Reviewed:7/5/2002
Keywords:kbbug kbusage KB128255