Microsoft KB Archive/207806

= ACC2000: HTML: Search for Hyperlink Fails with Specified Criteria =

Article ID: 207806

Article Last Modified on 6/24/2004

-

APPLIES TO


 * Microsoft Access 2000 Standard Edition

-



This article was previously published under Q207806



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

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



SYMPTOMS
When you enter a hyperlink address in the Criteria cell of a query to return all the records that are associated with that hyperlink, no records are returned. This happens even though records in the table appear to meet the criteria that you specified.



CAUSE
The criteria does not contain the full, underlying value of a Hyperlink field.



RESOLUTION
When you search for a hyperlink address, include the asterisk character (*) within your search criteria. For example, to retrieve all records that contain www.microsoft.com, type: LIKE "*www.microsoft.com*"



MORE INFORMATION
Microsoft Access Hyperlink fields have the following three sections. The sections are separated by number signs (#):
 * Text to display - the text that appears in a field or control.
 * Address - the path to a file (UNC path) or page (URL).
 * Subaddress - a location within the file or page.

For example

Microsoft Corporation#http://www.microsoft.com#Sample

where:

Text to display = Microsoft Corporation

Address = http://www.microsoft.com

Subaddress = Sample

When you view Hyperlink fields in a datasheet, in a form, or in a report, Microsoft Access shows only the display text portion of the fields. Or if you entered a UNC path or a URL without display text, Access shows only the path or the URL. Because the Datasheet (or another) view may not display the entire value associated with a Hyperlink value, place an asterisk (*) on either side of your criteria.

Steps to Reproduce Behavior
 Open the sample database Northwind.mdb. Open the Suppliers table, and then scroll to the HomePage field. Note the names of the first two Home pages:

CAJUN.HTM

Mayumi's (on the World Wide Web)

 Close the Suppliers table. Create a new query based on the Suppliers table, and add the HomePage field to the query grid. Type the following criteria in the Criteria cell:

"CAJUN.HTM" or "Mayumi's (on the World Wide Web)"

 Run the query. Note that the query returns no records.</li> Switch back to Design view of the query, and type the following criteria in the Criteria cell:

"*CAJUN.HTM*" or "*Mayumi's (on the World Wide Web)*"

</li> Run the query again. Note the query now returns the correct records.NOTE: To view the entire Hyperlink value:

<ol style="list-style-type: lower-alpha;"> Add the following expression to the query design grid:

Expr1: Mid([HomePage],1)

</li> Run the query.</li></ol> </li></ol>

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.

<div class="references_section">