Microsoft Knowledge Base Email Alertz

(207806) - 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.

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

Article ID: 207806 - Last Review: June 24, 2004 - Revision: 2.0

ACC2000: HTML: Search for Hyperlink Fails with Specified Criteria

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

  1. Open the sample database Northwind.mdb.
  2. 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)
  3. Close the Suppliers table. Create a new query based on the Suppliers table, and add the HomePage field to the query grid.
  4. Type the following criteria in the Criteria cell:
    "CAJUN.HTM" or "Mayumi's (on the World Wide Web)"
  5. Run the query. Note that the query returns no records.
  6. 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)*"
  7. Run the query again. Note the query now returns the correct records.NOTE: To view the entire Hyperlink value:

    1. Add the following expression to the query design grid:
      Expr1: Mid([HomePage],1)
    2. 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, click Microsoft Access Help on the Help menu, type hyperlink fields and controls in the Office Assistant or the Answer Wizard, and then click Search to view the topics returned.

APPLIES TO
  • Microsoft Access 2000 Standard Edition
Keywords: 
kbprb kbusage KB207806
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate