Hyperlinks from fields in Access

  • Thread starter Thread starter Oleg
  • Start date Start date
O

Oleg

Hi,

In my database I have a field where URLs will be stored. They will be
stored by users and each record will have a different URL. I want to
places a button or label next to the URL text box where someone can
click and it will open the URL in the nearby field. I need to know how
to pass the URL from a text field and assign it to a label or button
that will open it in IE or defaul browser. Thanks!
 
Hi Oleg,

Check out the Application.FollowHyperlink method. That's the basis of what
you want, and there are a number of parameters to pass to it, depending on
how you want the called application to respond.

If your textbox name is txtURL, you can use a command button to run the URL
with the line in the button's click event:

Application.FollowHyperlink txtURL, ... 'with other parameters as you
require

You could put the same code in the textbox's DoubleClick event, and the URL
will open just by double-clicking in the textbox itself. If you set the
textbox's Is Hyperlink property to Yes (it's at the bottom of the Format tab
in the properties sheet), the URL will display as a conventional hyperlink
(blue, underlined).

HTH,

Rob
 
Got it, thanks!

Rob said:
Hi Oleg,

Check out the Application.FollowHyperlink method. That's the basis of what
you want, and there are a number of parameters to pass to it, depending on
how you want the called application to respond.

If your textbox name is txtURL, you can use a command button to run the URL
with the line in the button's click event:

Application.FollowHyperlink txtURL, ... 'with other parameters as you
require

You could put the same code in the textbox's DoubleClick event, and the URL
will open just by double-clicking in the textbox itself. If you set the
textbox's Is Hyperlink property to Yes (it's at the bottom of the Format tab
in the properties sheet), the URL will display as a conventional hyperlink
(blue, underlined).

HTH,

Rob
 
Back
Top