We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

Issue with Hyperlink 'Text to Display' containing # Symbol in Access

filtrationproducts
on
Medium Priority
478 Views
Last Modified: 2013-11-28
I have a Access front end that displays a hyperlink retreived from a SQL server. The problem is that one of the 'text to display' part numbers has a # symbol in it and that causes it truncate or not connect to the proper hyperlink in the back ground. Is there a way to encapsulate this # symbol so it wont affect the hyperlink?
Comment
Watch Question

Jeffrey CoachmanMIS Liason
CERTIFIED EXPERT
Most Valuable Expert 2012

Commented:
filtrationproducts,

Well, without seeing the string, all I can suggest is that you replace the  "#" with an empty string (""):

    YourHyperlinkField=Replace(YourHyperlinkField,"#","")

Can you paste the string here for us to examine?

JeffCoachman
Jeffrey CoachmanMIS Liason
CERTIFIED EXPERT
Most Valuable Expert 2012

Commented:
Or wrap in single quotes

    YourHyperlinkField=Replace(YourHyperlinkField,"#","'#'")
ioanePlanning & Analytics Manager

Commented:
filtrationproducts,

I don't tihink there is anyway to include the # in any part of a hyperlink.

boag2000 is right about needing to replace the # but you only want to replace the first instance so:
YourHyperlinkField=Replace(YourHyperlinkField,"#","",1)

Note: this will only work with situations where there is a hash (#) in the display text.

You may want to count the number of #'s first to determine if there are more than 3 etc.

Author

Commented:
The hyperlink is created from a query. Here is what the problem hyperlink data looks like.

TORO # 74-3570#J:\elements\documentation\TORO # 74-3570.SLDDRW#

Author

Commented:
I tried putting the code below in the query for the "display text" field. But its not working.
Replace("#","")

How can I configure the 1 column in the query to remove the # symbols.
temp.JPG

Author

Commented:
I changed ID to display only the word "drawing" but the # symbol in the hyperlink itself causes it to error. I dont know if this is going to be possible.

Is there anyway to make a hyperlink containing a # symbol work in Access. I cant remove the # because its the actual filename and this cannot be changed.
Planning & Analytics Manager
Commented:
Hi filtrationproducts,

As I stated in my comment above, for the replace function to work you need to only replace the first instance of the #.
i.e. Replace("#","",1)

If you have a # in your actual filename then you probably need to do away with the hyperlink altogether and just store the filename as a text string.

You can then emulate a hyperlink by using the OnClick event and the FollowHyperlink function.
i.e. FollowHyperlink("J:\elements\documentation\TORO # 74-3570.SLDDRW",,True)

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

Commented:
Tramtrak: I will try that now
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.