ACC1x: ApplyFilter Action Causes Form to Be Read-Only
ID: Q99318
|
The information in this article applies to:
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
- In the sample database NWIND.MDB, create a new query based on the
Customers and Orders tables. Join the tables on [Customer ID].
- 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.
- Save the query and create a new form based on it. Drag several
fields from the field list to the form.
- Create a macro with an ApplyFilter action. Set the macro's Where
Condition argument to:
[Company Name] Like "c*"
- Save the macro and drag it onto the form.
- Switch to Form view. Verify that you can edit fields.
- 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
Issue type : kbbug