I want pasted url's in "text" datatype cells to be hyperlinked

mr-scarface

New member
Local time
Today, 00:29
Joined
Oct 11, 2008
Messages
2
Basically I have a few tables in my database. In these tables I have some fields which are set to the "text" datatype. However, I want to be able to paste url's into these cells and have it hyperlink those urls automatically. This way I can simply click on the hyperlink and it opens them.

As it stands right now, it does not hyperlink the pasted text because the fields are set to "text" . If I change datatype to hyperlink, then I can't put normal text into it.

So please tell me if there's a way to do this.

Thanks in advance.
 
You can use the VBA method FollowHyperlink

For instance if you just want the user to click on the box containing the link, then you can create an On Click even and enter the following code:

Application.FollowHyperlink Me.myTextBox


The whole code will look something link this:
Code:
Private Sub myTextBox_Click()
Application.FollowHyperlink Me.myTextBox
End Sub

You don't have to use the On Click event. You could use the On Dbl Click event or you could add a button.

hth
Chris
 
yes you can, but make sure if you are going to use this method to FORMAT the textbox appropriately! People know hyperlinks by the BLUE underlined text that they see. Not much else. ;)

The only thing you might want to do with the boxes are DISABLE and LOCK them. If you turn both of these properties OFF, you won't see a vertical cursor when the user hovers over the box. Don't want them to get confused! :)
 
You can use the VBA method FollowHyperlink

For instance if you just want the user to click on the box containing the link, then you can create an On Click even and enter the following code:

Application.FollowHyperlink Me.myTextBox


The whole code will look something link this:
Code:
Private Sub myTextBox_Click()
Application.FollowHyperlink Me.myTextBox
End Sub
You don't have to use the On Click event. You could use the On Dbl Click event or you could add a button.

hth
Chris

I'm sorry I probably should have mentioned that I'm a total noob in access. I can enter into Visual basic and right click on my database name and choose insert ---> module. Then a box pops up. Is this where I type the code?

Note that I have approximately 100 tables in total, in 3 different groups. But most of the tables are currently empty, as I haven't entered/pasted my data into them yet because I want to make sure this hyperlinking thing is set up first.
 
I'm sorry I probably should have mentioned that I'm a total noob in access. I can enter into Visual basic and right click on my database name and choose insert ---> module. Then a box pops up. Is this where I type the code?
You would take that approach if you were writing a standalone function or subroutine.

The approach you need to take depends on how you want things to work on screen. Most often you will get code to run using Events. There are many different events. For example, for a button, there is an event called On Click (there are others). So you could attach code to this event so that when the user clicks the button, the code runs. Sorry if I'm labouring the point.

I kind of understood that you wanted to click on the hyperlink and off you go. For text boxes there is also an event called On Click. In the properties for that text box you will find an attibute called On Click. If you click on this link you will see a couple of grey buttons appear on the far right of the line. Click on the one with the three dots. When asked to choose builder, choose Code Builder. This will create the first and last line of code for you and you just need to add the middle bit.

Adam made some very valid points about the screen design.

Chris
 
Note that I have approximately 100 tables in total, in 3 different groups. But most of the tables are currently empty, as I haven't entered/pasted my data into them yet because I want to make sure this hyperlinking thing is set up first.
This is a scary statement. This suggests a dire structural design. I bet you can get away with 3 tables if you have 3 groups or maybe even one. What are you trying to do?
 

Users who are viewing this thread

Back
Top Bottom