John Q. Noob
John Q. Noob

Reputation: 181

Syntax for # literal in ms-access hyperlink?

This seems like it ought to be a trivial question, but I'm having a hell of a time finding an answer for this so far...

I have an access database that stores hyperlinks to files on a shared network drive. The link targets are specified as simple file paths (e.g. "G:\directoryname\filename.ext") rather than proper URL's ("http://domain.ext/link").

This works fine in general, but I've recently run into a problem involving file names that contain the "#" character. (It is not an option to change the file names to remove the # characters)

If I try to set up a link to something like "G:\directoryname\ExampleFile#24.pdf", then Access parses the # in the filename as it would generally do when it defines a hyperlink. The resulting target is just ""G:\directoryname\ExampleFile", with the portion of the link following the offending "#" simply being truncated.

Now, obviously if the link target were a regular URL, I would just replace the "#" in the text of the link with "%23" and there would be no issue.

The problem is that, if I do that here, my network file action fails, because unlike when opening a regular URL through a browser, the network doesn't recognize %23 as equivalent to # ( I get an error saying "Unable to open G:\directoryname\ExampleFile %23 24.pdf. Cannot open the specified file.")

Is there a more direct way to have ms-access record the link target with a literal # character included?

Upvotes: 0

Views: 1176

Answers (1)

random_answer_guy
random_answer_guy

Reputation: 856

Well this certainly doesn't help you but here is your answer:

"You cannot use a pound character in a file name for a hyperlink in an Office program"

https://support.microsoft.com/en-us/kb/202261

Upvotes: 1

Related Questions