ACC2002: Filter By Selection Does Not Handle Wildcard Characters Well (275066)



The information in this article applies to:

  • Microsoft Access 2002

This article was previously published under Q275066
Novice: Requires knowledge of the user interface on single-user computers.

This article applies only to a Microsoft Access database (.mdb).

SYMPTOMS

When you use the question mark (?) or the asterisk (*) character as the criteria for a "Filter By Selection," the filter is not applied.

CAUSE

Microsoft Access interprets the ? and the * characters as wildcard characters.

RESOLUTION

Manually insert square brackets ([ ]) around the character in the filter statement. To see an example of how to do this, follow these steps:
  1. Select the character on which to filter.
  2. On the Records menu, point to Filter, and then click Advanced Filter/Sort.
  3. Change the criteria from Like "*?*" to Like "*[?]*".
  4. On the Filter menu, click Apply Filter/Sort.
Note that only records that contain ? are returned.

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION

Steps to Reproduce the Behavior

  1. Start Microsoft Access and create a new database.
  2. Create the following table:
       Table: Table1
       -----------------
       Field Name: F1
       Data Type: Number
    
       Field Name: F2
       Data Type: Text
    					
  3. Switch to Datasheet view, and enter the following data:
       F1    F2
       --------
       1    AAA
       2    A?B
       3    BBB
       4    B?A
    					
  4. Select "?" in the F2 field of the second record (A?B).
  5. On the Records menu, point to Filter, and then click Filter By Selection.
All records appear in the filtered results. To see the filter statement that was created, point to Filter on the Records menu, and then click Advanced Filter/Sort.

Modification Type:MajorLast Reviewed:11/5/2003
Keywords:kbbug kbnofix KB275066