ACC2000: Find Does Not Work with Fields Containing # Character (208438)



The information in this article applies to:

  • Microsoft Access 2000

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

SYMPTOMS

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
  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 that you just entered.
  4. On the Edit menu, click Find. Set the following options in the Find in Field 'Description' dialog box:
       Find What: Hello#
          Search: All
           Match: Whole Field
    					
  5. Click Find Next. 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 finding data, click Microsoft Access Help on the Help menu, type find or replace data in the Office Assistant or the Answer Wizard, and then click Search to view the topic.

For more information about control characters, click Microsoft Access Help on the Help menu, type using wildcard characters in string comparisons. in the Office Assistant or the Answer Wizard, and then click Search to view the topic.

Modification Type:MajorLast Reviewed:6/29/2004
Keywords:kbprb kbusage KB208438