ACC97: HTML: Search for Hyperlink Fails with Specified Criteria

ID: Q164773


The information in this article applies to:
  • Microsoft Access 97


SYMPTOMS

Moderate: Requires basic macro, coding, and interoperability skills.

When you type a hyperlink address on the Criteria line in a query to return all records associated with that hyperlink, no records are returned, even though records that meet the specified criteria do exist in the table.


CAUSE

Microsoft Access Hyperlink fields consist of the following three sections separated by number signs (#): the Displaytext, the Address, and the Subaddress. When you view these fields in a datasheet, a form, or a report, Microsoft Access just displays the Displaytext portion of the fields. Therefore, to return records where the Displaytext or Address is a string, you must put an asterisk (*) on either side of the string.


RESOLUTION

When you search for a hyperlink address, you must include the asterisk character (*) in your search argument. For example, to retrieve all records that contain www.microsoft.com, type:

Like "*www.microsoft.com*"


MORE INFORMATION

Steps to Reproduce Behavior

  1. Open the sample database Northwind.mdb.


  2. Open the Suppliers Table and scroll to the HomePage field. Note the names of the first two Home pages you can link to:


  3. CAJUN.HTM
    Mayumi's (on the World Wide Web)
  4. Close the Suppliers table.


  5. Create a query based on the Suppliers table and add the HomePage field to the query grid.


  6. Type the following on the Criteria line:


  7. "CAJUN.HTM" or "Mayumi's (on the World Wide Web)"
  8. Run the query and note that no records are returned.


  9. Switch back to Design view of the query and type the following on the Criteria line:
    "#CAJUN.HTM#" or "*Mayumi's (on the World Wide Web)*"
    Note that the correct records are returned.

    NOTE: In order to understand this method of searching, you must know what part of the hyperlink field Microsoft Access is showing in Datasheet view. A simple way to see this is to do the following:


    1. Create a query based on the Suppliers table.


    2. Add the HomePage field to the query grid.


    3. Create the following expression: expr1:mid([HomePage],1).


    4. Run the query.


You can now see the entire contents of the field, including the number signs (#). This can help you identify what criteria will work best for you in your searches.


REFERENCES

For more information about Hyperlink fields, search the Help Index for "hyperlink fields and controls," or ask the Microsoft Access 97 Office Assistant.

Additional query words: URL URLs

Keywords : kbusage
Version : WINDOWS:97
Platform : WINDOWS
Issue type : kbprb


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