Microsoft KB Archive/207852

= ACC2000: Cannot Hyperlink to Documents with # in the Name =

Article ID: 207852

Article Last Modified on 6/24/2004

-

APPLIES TO


 * Microsoft Access 2000 Standard Edition

-



This article was previously published under Q207852



Novice: Requires knowledge of the user interface on single-user computers.

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



SYMPTOMS
If you include the number sign (#) character in a hyperlink file name, the hyperlink URL is truncated after the number sign. When you click the hyperlink, you may receive the following error message:

Unable to open. Cannot open the specified file.

If the number sign is the first character in the file name, the hyperlink is truncated at the end of the file's directory path, and Windows Explorer opens the folder where the file is located.



CAUSE
Hyperlinks in Microsoft Access are stored as modified Memo fields, with the # character as a delimiter. The # character is essentially a reserved character for hyperlinks.



RESOLUTION
Do not use the # character in hyperlink file names.



Hyperlink on a Form
 Save a text file as link#hltest.txt on the root directory of your local hard disk (drive C). Start Microsoft Access, and then open any database. In the Database window, click Forms under Objects, and then click New. In the New Form dialog box, click OK without selecting a table or query to base the form on. On the Insert menu, click Hyperlink.</li> In the Insert Hyperlink dialog box, under Link to, click Existing File or Web Page. In the Type the file or Web page name box, type C:\link#hltest.txt, and then click OK.</li> On the View menu, click Form View.</li> Click the hyperlink. Note that you receive the following error message:

Unable to open hltest.txt. Cannot open the specified file.

Note that the first part of the file name up to and including the number sign (#) is missing from the file name, and that the file does not open.</li></ol>

Hyperlink in a Table

 * 1) Save a text file as #linktest.txt on the root directory of your local hard disk (drive C).
 * 2) Start Microsoft Access, and then open any database.
 * 3) In the Database window, click Tables under Objects, and then click New.
 * 4) In the New Table dialog box, click Design View, and then click OK.
 * 5) Create a field named Hlink with a Hyperlink data type. Save the table as Table1.
 * 6) Open Table1 in Datasheet view.
 * 7) On the Insert menu, click Hyperlink.
 * 8) In the Insert Hyperlink dialog box, under Link to, click Existing File or Web Page. Under Browse to, click the File button, and then, in the Link to File dialog box, select the #linktest.txt file on drive C. Click OK twice.
 * 9) In the Table1, click the hyperlink. Note that Windows Explorer opens the folder where the file is located but does not open the file.

<div class="references_section">