ACC97: HTML: Search for Hyperlink Fails with Specified Criteria
ID: Q164773
|
The information in this article applies to:
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
- Open the sample database Northwind.mdb.
- Open the Suppliers Table and scroll to the HomePage field. Note the
names of the first two Home pages you can link to:
CAJUN.HTM
Mayumi's (on the World Wide Web)
- Close the Suppliers table.
- Create a query based on the Suppliers table and add the HomePage
field to the query grid.
- Type the following on the Criteria line:
"CAJUN.HTM" or "Mayumi's (on the World Wide Web)"
- Run the query and note that no records are returned.
- 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:
- Create a query based on the Suppliers table.
- Add the HomePage field to the query grid.
- Create the following expression: expr1:mid([HomePage],1).
- 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