work-around for hyperlink reserved character restriction

W

Wendy Farkas

kb article #207852 notes that you can't hyperlink to documents with # in the
name, which prevents you from linking to an anchor in a web page. Is there a
work-around for this limitation?

TIA
 
A

Allen Browne

Wendy, the article is dealing with file names that have a # in the name, and
the problem is that Access truncates the name there and assumes the rest
*is* the anchor name in the page.

You should have no problem at all inserting a link such as:
http://allenbrowne.com/tips.html#apps
You might see it display with a hyphen, but it should work correctly.
 
W

Wendy Farkas

Allen,

Thanks for your response.

For this URL
http://www.mvps.org/dmcritchie/excel/excel.htm#tutorials
I had entered the following in a field of the type hyperlink
http://www.mvps.org/dmcritchie/excel/excel.htm-tutorials

It returned the following message:
Unable to open http://www.mvps.org/dmcritchie/excel/excel.htm-tutorials
The Internet site reports that the item you requested could not be found
(HTTP/1.0 404)

When I entered the URL you mentioned, replacing the "#" with "-", it
returned the following message:
Unable to open apps. Cannot open the specified file.

Did I miss something/do something wrong?

Wendy
 
A

Allen Browne

Right-click the hyperlink to edit it.
In the dialog, you can see the Display text, and the link.
The display text will probably show the dash, but the link should contain
the #.

That works fine here (tested in Access 2003.)

Another way to test what is actually in the field would be to use
HyperlinkPart() in the Immediate window (Ctrl+G).
 
W

Wendy Farkas

Allen,

I edited the hyperlink as you suggested - link still doesn't work from the
field. I'm using Access 2000. Do you think they added a functionality to the
2003 version that would explain why you're getting it and I'm not?

I'm just beginning to learn how to work with the VB Editor, so I probably
didn't get the 2nd part of your suggestion right. I typed into the Immediate
window:
HyperlinkPart (http://www.mvps.org/dmcritchie/excel/excel.htm#tutorials)
which returned: Compile error: expected: list separator or )

W
 
A

Allen Browne

Hi Wendy.

Okay, I just tried this in Access 2000, and I did receive the last error
message you posted. It seems that A2000 does parse the name incorrectly if
you paste it into the link.

However, you can fix that if you right-click the entry and Edit the
hyperlink. Everything up to the # is shown in the "Text to Display", and
everything after the # is shown in the "Type of file or Web page name".
That's clearly wrong. You need the entire link in the 2nd box. If you paste
the text in there, the link should work.

So, it looks like the Access 2000 *interface* parses the hyperlink
incorrectly, and you can work around that by editing the link yourself.

HTH
 
Top