ACC97: Filter By Form or Selection Changes DataEntry Property

Last reviewed: April 1, 1997
Article ID: Q164985
The information in this article applies to:
  • Microsoft Access 97

SYMPTOMS

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

When you use Filter By Selection or Filter By Form commands on a form that has its DataEntry property set to Yes, Microsoft Access changes the property setting to No so that it can display the filtered records.

This behavior is the same for both main forms and subforms.

CAUSE

Microsoft Access sets the DataEntry property of the form to False so that it can display the filtered records.

RESOLUTION

If you want to use your form only for data entry, you can do one of the following:

  • Use custom menus and toolbars with your form so that users cannot carry out the Filter By Form or Filter By Selection commands. This is the recommended method.
  • Use Visual Basic code or a macro in the Current event of the form to reset the DataEntry property to True. While this method does work, it can slow down performance of your form when users click the Filter By Form or Filter By Selection commands.

You can find information, instructions, and examples in the Developer Solutions sample application (Solutions.mdb) included with Microsoft Access 97. For more information about creating a custom menu for a form, open the Solutions.mdb database, usually located in the Access\Samples folder. Select Sample Forms in the "Select a Category of Examples" box, and then EditProducts in the Select An Example box.

For more information about setting form properties in the Current event, search the Help Index for "OnCurrent property" or "properties, events."

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Start Microsoft Access and open the sample database Northwind.mdb.

  2. Using the Autoform: Columnar Wizard, create a new form based on the Customers table.

  3. Switch to Design view and set the following properties of the form:

          AllowEdits: No
          AllowDeletions: No
          AllowAdditions: Yes
          DataEntry: Yes
    

  4. Save the form as AddCustomer, and then switch to Form view.

  5. On the Records menu, point to Filter, and then click Filter By Form.

  6. Select WA in the Region field.

  7. On the Filter menu, click Apply Filter/Sort. Note that the form displays existing records.

  8. Press CTRL+G to open the Debug window.

  9. Type the following line in the Debug window, and then press ENTER:

          ?Forms!AddCustomer.DataEntry
    

    Note that the value of the DataEntry property is False.


Keywords : FmsProb FmsProp FmsSubf kbusage
Version : 97
Platform : WINDOWS
Hardware : x86
Issue type : kbprb


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: April 1, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.