link problem

G

Guest

Hi, I posted a few days ago with no response so am hopeful someone might
respond with an answer this time.
I have an unbound form which is populated from a table containing a
hyperlink. In the table, the data type is set to hyperlink and contains for
example www.test.com
When it is displayed in the form is appears as
www.test.com#http://www.test.com/#
What I actually want on the form is for it to display http://www.test.com or
even just www.test.com and be able to click the link. Can anyone tell me what
needs to be changed for this to work properly. i can't find anything in help
that makes sense to me.
 
R

RuralGuy

Hi, I posted a few days ago with no response so am hopeful someone
might respond with an answer this time.
I have an unbound form which is populated from a table containing a
hyperlink. In the table, the data type is set to hyperlink and
contains for example www.test.com
When it is displayed in the form is appears as
www.test.com#http://www.test.com/#
What I actually want on the form is for it to display
http://www.test.com or even just www.test.com and be able to click the
link. Can anyone tell me what needs to be changed for this to work
properly. i can't find anything in help that makes sense to me.

Hi Sam,

The last property of the Format tab of the TextBox is "Is Hyperlink".
Is yours set to Yes?

HTH
 
G

Guest

Hi,
Yes, the 'ishyperlink' property is set to 'yes'
It looks like a hyperlink but the format remains wrong and it does nothing
when the mouse moves over it... i.e I can't click it to open the link.
If I set the record source to the table i.e. make it a bound form, it works
as it should but unbound it doesn't.

I'm using DAO and the line to populate is Forms!frmCompany.txtCompWeb =
!CompWeb which is a module Public Function GetCompany()

I can't work out where things are going wrong.
 
R

RuralGuy

Hi,
Yes, the 'ishyperlink' property is set to 'yes'
It looks like a hyperlink but the format remains wrong and it does
nothing when the mouse moves over it... i.e I can't click it to open
the link. If I set the record source to the table i.e. make it a bound
form, it works as it should but unbound it doesn't.

I'm using DAO and the line to populate is Forms!frmCompany.txtCompWeb
= !CompWeb which is a module Public Function GetCompany()

I can't work out where things are going wrong.

Hello again Sam,

Well I did a little research (read googling) and now I'm going
to seem a lot smarter that I really am! I'm certainly wiser that I
was before the research.

It turns out that unbound TextBoxes don't work for HyperLinks!
That's something I did not know, since I had never tried them
that way. Big surprise to you, right? 8^)

There are at least two possible work arounds:
1) Application.FollowHyperlink
2) Use a label instead of a textbox - they have a Hyperlink property

Here's some code if you want to use a Label:

If Not IsNull([HyperlinkField]) Then
Me.Label99.Caption = _
Left([HyperlinkField], InStr(1, [HyperlinkField], "#") - 1)
Me.Label99.HyperlinkAddress = [HyperlinkField]
End If

Replace [HyperlinkField] with your source, and replace Label99
with your label name.

My Access 2K2 put the HyperlinkAddress in the ControlTip PopUp
until I put "Follow this link" in the ControlTip on the "Other" Tab.

You actually get the little hand and everything. It just wasn't
underlined.

By the way, the google thread was at least 6 years old. Obviously
this issue has been out there for a while.

There, now we are both a little wiser than before! ;^)

HTH
 
G

Guest

Hi,
Thanks for all your help. That is quite a surprise.... no wonder I couldn't
get it to work. It's an odd thing that it doesn't work in unbound forms and
something to be careful of if it is a requirement that has to work.
 
R

RuralGuy

Hi,
Thanks for all your help. That is quite a surprise.... no wonder I
couldn't get it to work. It's an odd thing that it doesn't work in
unbound forms and something to be careful of if it is a requirement
that has to work.

You're welcome Sam. Thanks for posting back and good luck with
your project.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top