ACC2000: Find Does Not Work with Fields Containing # Character

ID: Q208438


The information in this article applies to:

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:


  3. 
       Category Name: Test Find
         Description: Hello# 
  4. Click in the Description field of any record in the Categories table above the one that you just entered.


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


  6. 
       Find What: Hello#
          Search: All
           Match: Whole Field 
  7. Click Find Next. Note that Microsoft Access does not find the record.


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


  9. 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.

Additional query words: prb


Keywords          : kbusage kbdta GnlFnd 
Version           : WINDOWS:2000
Platform          : WINDOWS 
Issue type        : kbprb 

Last Reviewed: May 13, 1999