ACC: Find Does Not Work with Fields Containing # Character

ID: Q109360


The information in this article applies to:
  • Microsoft Access versions 1.0, 1.1, 2.0, 7.0, 97


SYMPTOMS

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

You cannot use the Find command to find fields containing the number sign (#) character.


CAUSE

The number sign character is a control character in Microsoft Access; the Find command does not treat it as it does regular characters.


RESOLUTION

To search for the number sign character (or any control character), you must place brackets around the control character. For example, to search for a record containing the text string "hello#", you would enter:


   hello[#] 


MORE INFORMATION

Steps to Reproduce Behavior


  1. Open the sample database Northwind.mdb (or NWIND.MDB in versions 1.x and 2.0).


  2. Open the Categories table in Datasheet view and add the following record:
    
          Category Name: Test Find
          Description: Hello# 


  3. Click in the Description field of any record in the Categories table above the one you just entered.


  4. On the Edit menu, click Find. Set the following options in the Find in Field: 'Description' dialog box:

    In Microsoft Access 7.0 and 97:
    
          Find What: Hello#
          Search: All
          Match: Whole Field
          Search Only Current Field: True (click this option) 

    In Microsoft Access 1.x and 2.0:
    
          Find What: Hello#
          Where: Match Whole Field
          Search In: Current Field
          Direction: Down 



  5. Click Find First. Note that Microsoft Access does not find the record.


  6. Repeat step 4, but type Hello[#] in the Find What box.


  7. Click Find First. Note that this time the record is found.



REFERENCES

For more information about using special characters with the Find feature, search the Help Index for "finding data, ways to."

For more information about control characters, search the Help Index for "wildcard characters."

Keywords : kbusage GnlFnd
Version : 1.0 1.1 2.0 7.0 97
Platform : WINDOWS
Issue type : kbprb


Last Reviewed: March 30, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.