Hyperlink datatype: Can I launch a browser from an Access form?

  • Thread starter Thread starter Dave
  • Start date Start date
D

Dave

I have a form that displays a hypertext field in a text box.

The link is blue and is underlined like a regular hyperlink but when I click
on it, nothing happens.

Is it possible to launch a browser from a hyperlink fieldon a form from
within Access 2003? If so, how?
 
Dave,

The below assumes that you have already set "Is Hyperlink"
= Yes and "Enabled" = Yes in the properties of your text
box.

Since you are using a text box control, the text box must
be bound to either a text field or a hyperlink field in a
table. Otherwise, your browser will not launch. I just
verified this through testing.

If the bound field underlying your text box is defined as
a *text* field, then you have to either manually or using
an input mask, surround the URL with a # on each side. If
the #s are missing, then your browser will fail to launch
when you click on the hyperlink.

If the bound field underlying your text box is defined as
a *hyperlink*, then the #s are automatically applied and
you just need to enter the URL. The browser should launch
by simply clicking on the text box control.

If you wish to entirely avoid using a bound control, then
you can use a (standalone) label control and use VBA to
populate the "Hyperlink Address," and optionally,
the "Hyperlink SubAddress" and "Caption" properties.
 
Thanks Mike for the detailed information.

Strange but I could not get the link to launch with I used a straight
hyperlink datatype and set the IsHyperlink property to yes.

However, I was able to get it to launch with a text field when I appended
the # sign as you suggested. I did not know how to create an input mask with
the # sign so did it in VBA as:

Private Sub Form_Current()
txtURL.Value = "#http://" & txtURL.Value & "#"
End Sub

Private Sub Form_Load()
txtURL.IsHyperlink = True
End Sub

Thanks for your help
Dave
 
Back
Top