ACC1x: ApplyFilter Action Causes Form to Be Read-Only

Last reviewed: May 14, 1997
Article ID: Q99318
The information in this article applies to:
  • Microsoft Access version 1.0

SYMPTOMS

Running a macro that contains an ApplyFilter action may cause a form to become read-only. This problem occurs if the form is based on a query that contains two tables with a one-to-many relationship and only records from the one side are included in the output of the query.

RESOLUTION

There is no way to prevent the ApplyFilter action from making the form read-only. However, you can use one of the following methods to filter the records displayed in a form:

  • Base the form on a parameter query. The user will then be prompted for the criteria with which to filter the records each time the form is opened. For more information on parameter queries, refer to pages 178-181 in the Microsoft Access "User's Guide."
  • Place the form in another form as a subform. Set up the LinkMaster and LinkChild properties so that one or more fields in the main form filter the data in the subform. For more information on subforms, refer to the pages 272-278 in the Microsoft Access "User's Guide."
  • Use Access Basic code to control the records displayed in the form. For more information, refer to pages 106-107 in the Microsoft Access "Introduction to Programming" manual.

STATUS

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

Steps to Reproduce Problem

  1. In the sample database NWIND.MDB, create a new query based on the Customers and Orders tables. Join the tables on [Customer ID].

  2. Drag all fields from the Customers table to the query grid. Drag down [Order ID] from the Order table. Add the criteria: >10080 and clear the Show box.

  3. Save the query and create a new form based on it. Drag several fields from the field list to the form.

  4. Create a macro with an ApplyFilter action. Set the macro's Where Condition argument to:

          [Company Name] Like "c*"
    

  5. Save the macro and drag it onto the form.

  6. Switch to Form view. Verify that you can edit fields.

  7. Press the macro button to apply the filter.

You can no longer edit or add records.


Additional query words: dynaset lock query
Keywords : kbusage McrActn
Version : 1.0
Platform : WINDOWS
Hardware : X86
Issue type : kbbug
Resolution Type : kbworkaround


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: May 14, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.