Hyperlink on forms

  • Thread starter Thread starter mbox204
  • Start date Start date
M

mbox204

I am attempting to build a hyperlink from a textbox entry of URL's.

I have a form, and on that form, txtboxA contains a website URL and on the
same form, label_URL contains the contents of txtboxA. Though I am able to
copy the content of txtboxA into label_URL, the hyperlink is not active. I
want the content of label_URL to be active as a hyperlink, so when it is
clicked, usera are taken to the corresponding website address. The contents
of label_URL will always correspond with the content of txtboxA and vary. I
am able to set all the hyperlink properties for label_URL, I don't seem to
have the ability to make the label_URL content active.

I know there is a hyperlink feature in Access, though it does not seem to be
variable, or I have setup wrong.

A little shove in the right direction will help immensely.

Thank you.
 
So far I have found this and it seems to work on a click event. Anything
improved is more than welcome.

Private Sub Label_URL_Click()

Dim ctl As Label

Set ctl = Me!Label_URL

With ctl
'.Visible = False
.HyperlinkAddress = me.txtURL
.Hyperlink.Follow
End With

End Sub
 
You can set the datatype of the field in your database to hyperlink. Doing
so will ensure that when it is displayed on screen it shows up on screen it
will show up in whatever your default hyperlink format is, and will allow
you to just click on the text box to go to the hyperlink.

HTH
Dale
 
Back
Top