424,066 Members | 2,123 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,066 IT Pros & Developers. It's quick & easy.

Hyperlink to Folder on Tab Control

P: 8
I have a form with a tab control. I am trying to include a hyperlink textbox within the tab but it's doing something weird. When I first add the Address, it works fine. If I remove focus from the textbox and then try to click it again, it shows the field codes. Clicking does nothing.

Example:
If I have the path C:/test/folder on a hyperlink with Text to Display "Open Folder", clicking places a cursor inside the textbox behind the field code:

Open Folder#C:/test/folder#


Before you ask, the control source is a hyperlink field in the source table. I have the "Is Hyperlink" property selected "Yes". Clicking Alt+F9 or Shift+F9 resets it and allows me to open the hyperlink, but if I remove focus the problem persists.

I have an identical box outside of the tab for testing and it works perfectly. I need it in the tab though. Could you please let me know any tips on how to fix this?

PS: I use unique paths for every record, so putting the address in VBA or in the property "Hyperlink Address" won't work.

Thanks!
4 Weeks Ago #1
Share this Question
Share on Google+
5 Replies


twinnyfo
Expert Mod 2.5K+
P: 2,780
I would avoid the whole "Hyperlink" field altogether. Make it a simple text field. Then, to jump to the folder, use this:

Expand|Select|Wrap|Line Numbers
  1. Call Application.FollowHyperlink(Address:=Me.txtFolderName)
I would also use a Command Button to execute the opening of the Folder. It sounds like you are using the OnFocus Event?

Hope this hepps!
4 Weeks Ago #2

P: 8
I appreciate the reply but this won't do the trick. I need the hyperlink to navigate to different folders depending on the record. I can't do a VBA function because the address is different for every record. VBA requires a single address.

I'm not using any VBA events currently. I was saying that the hyperlink only works right after I put the address in. If I reopen the form or click away from the textbox and then try to click it again, I get the error.

PSS: I have multiple databases with hyperlink textboxes and have never had an issue. The problem only occurs when the textbox is placed in a tab control.
4 Weeks Ago #3

twinnyfo
Expert Mod 2.5K+
P: 2,780
I appreciate the reply but this won't do the trick. I need the hyperlink to navigate to different folders depending on the record. I can't do a VBA function because the address is different for every record. VBA requires a single address.
No--it does not. If you look at the VBA example I showed you, it uses the value of your text box.

I'm not using any VBA events currently. I was saying that the hyperlink only works right after I put the address in. If I reopen the form or click away from the textbox and then try to click it again, I get the error.
Then how are you calling your hyperlink? It must be called from an event. Whether you are using a macro (highly discouraged) or VBA, you must still link the activity to an event--which is unclear from your statements thus far.

PSS: I have multiple databases with hyperlink textboxes and have never had an issue. The problem only occurs when the textbox is placed in a tab control.
The location of your text box should be completely immaterial. It would be helpful for us to know how you are calling your folder to open (see the previous paragraph, and my initial inquiry).

On a side note, if you have multiple databases, then it behooves you to begin learning VBA. Macros are extremely limited, and once you begin using VBA, you will gain an appreciation for its relative simplicity as well as its flexibility and usefulness.
4 Weeks Ago #4

P: 8
I appreciate your fast response.

Maybe a bit of background might help. I'm making a form for customer records and the hyperlink path goes to each customer's personal folder in our system.
I enter the hyperlink address by rightclicking the textbox, going to Edit Hyperlink, and adding the address. This method has always worked before.

I'll try the method you suggested again and get back to you tomorrow. Thanks again for your help.
4 Weeks Ago #5

NeoPa
Expert Mod 15k+
P: 31,170
Sound advice there from Twinny.

You can play around with hyperlinks, but there's really very little point in Access where you have controls and events behind them. It's just simpler and more straightforward.
4 Weeks Ago #6

Post your reply

Sign in to post your reply or Sign up for a free account.