ACC: Filter By Selection Fails in Value-List-Filled Combo Box

Last reviewed: May 30, 1997
Article ID: Q139042
The information in this article applies to:
  • Microsoft Access versions 7.0, 97

SYMPTOMS

Novice: Requires knowledge of the user interface on single-user computers.

If you highlight part of the text in the text box portion of a combo box and click Filter By Selection on the toolbar, no records are returned.

CAUSE

The combo box is filled with a value list and the bound column is not the first displayed column in the list. When you highlight just part of the text in the text box portion of a combo box, Microsoft Access cannot match the text highlighted in the displayed column with the data from the bound column that is actually stored in the underlying table's field.

RESOLUTION

To work around this behavior, display the bound column as the first visible column in the combo box list, or fill the combo box with values from a table or query.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Open the sample database Northwind.mdb and add the following new field to the Employees table:

          Field Name: Gender
    
             Data Type : Text
             Field Size: 1
             Display Control: combo box
             RowSourceType: Value List
             RowSource: Male;M;Female;F
             BoundColumn: 2
             ColumnCount: 2
             ColumnWidths: ;0
             ListRows: 2
    
    

  2. Save the changes and view the Employees table in Datasheet view.

  3. Select Male or Female for the new Gender field for each Employee record.

  4. In a record with Female selected as the gender, highlight the letters "m-a-l-e" in the text box portion of the combo box control and click the Filter By Selection toolbar button. Note that no records are returned.

    NOTE: When you click the menu item Records, Filter, Advanced Filter/Sort, you'll find that the criteria on the Gender field is

          Like "*male"
    

    which does NOT match the M or F stored in the field.

  5. Click the Remove Filter toolbar button.

  6. In a record with Male selected as the gender, highlight "Male" in the text box portion of the combo box control and click the Filter By Selection toolbar button. Note that records with gender "Male" are returned.

    The reason is that because you highlighted the entire textual contents of the text box portion of the combo box control, Microsoft Access can use the bound column value for the criteria for the field.

    NOTE: If you click the menu item Records, Filter, Advanced Filter/Sort, you'll find that the criteria on the Gender field is "M".


Additional query words: fbf fbs
Keywords : FmsOthr kbusage
Version : 7.0 97
Platform : WINDOWS
Hardware : X86
Issue type : kbprb
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 30, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.