Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

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


View products that this article applies to.

Symptoms

If you select 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.

↑ Back to the top


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 select just part of the text in the text box portion of a combo box, Microsoft Access cannot match the selected text in the displayed column with the data from the bound column that is actually stored in the underlying table's field.

↑ Back to the top


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.

↑ Back to the top


More information

Steps to Reproduce Behavior

CAUTION: If you follow the steps in this example, you modify the sample database Northwind.mdb. You may want to back up the Northwind.mdb file and follow these steps on a copy of the database.

  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, select 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: If you click the Advanced Filter/Sort command (on the Records menu, point to Filter), you see 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, select 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 records with gender "Male" are returned.

    The reason is that because you selected 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 Advanced Filter/Sort command (on the Records menu, point to Filter), you see that the criteria on the Gender field is "M".

↑ Back to the top


Keywords: KB208700, kbprb, kbarchive, kbnosurvey

↑ Back to the top

Article Info
Article ID : 208700
Revision : 2
Created on : 10/11/2013
Published on : 10/11/2013
Exists online : False
Views : 346