By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,688 Members | 1,226 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,688 IT Pros & Developers. It's quick & easy.

Contents of a Hyperlink Control

P: n/a
A2003, XP Pro.

I have a text box on a form. The text box is bound to a hyperlink field. I
want to use the contents of the text box in code so I'm assigning the
contents to a string variable. Typically, the contents would be:

T:\CSDI\Projects\Library\002\8021889.doc

but when I look at the variable what I see is:
T:\CSDI\Projects\Library\002\8021889.doc#T:\CSDI\P rojects\Library\002\8021889.doc#

I'm assigning the string to the variable using:
strHyperlink = Me.txtDocLink

Is there a property of the hyperlink I should be using or do I have to write
code to trim the string?

Many thanks.
Keith.
Jan 18 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Keith Wilby wrote:
A2003, XP Pro.

I have a text box on a form. The text box is bound to a hyperlink field. I
want to use the contents of the text box in code so I'm assigning the
contents to a string variable. Typically, the contents would be:

T:\CSDI\Projects\Library\002\8021889.doc

but when I look at the variable what I see is:
T:\CSDI\Projects\Library\002\8021889.doc#T:\CSDI\P rojects\Library\002\8021889.doc#

I'm assigning the string to the variable using:
strHyperlink = Me.txtDocLink

Is there a property of the hyperlink I should be using or do I have to write
code to trim the string?

Many thanks.
Keith.

Use HyperlinkPart. There is "what you display to the user" and then
there is the link. "DisplayThis"#http://www.microsoft.com# is a valid
hyperlink

You can split them like
strD = HyperlinkPart(hyper,acDisplay)
strA = HyperlinkPart(hyper,acAddress)

Of course, you can use HyperlinkPart in queries but use the value of
acDisplay and acAddress. BTW, you can also use a subaddress if you need
to get that far.

The thing I detest about hyperlinks, using them in a datasheet or
continuous form, is that MS decided to make them link on a single click.
I think that MS should allow the developer to decide which click event
launches the link instead of making their, imo, flawed decisions. Now,
it wouldn't be so bad...the single link launch...but if you are tapping
the mouse here and there and you land on a hyperlink field or you want
to edit the hyperlink, you end up going to the link instead. I usually
separate the two and display only the display part to the user with the
text in blue underline. Then I can fire off the link on the event I want.

Jan 18 '06 #2

P: n/a
"salad" <oi*@vinegar.com> wrote in message
news:jM*****************@newsread2.news.pas.earthl ink.net...
Keith Wilby wrote:
A2003, XP Pro.

I have a text box on a form. The text box is bound to a hyperlink field.
I want to use the contents of the text box in code so I'm assigning the
contents to a string variable. Typically, the contents would be:

T:\CSDI\Projects\Library\002\8021889.doc

but when I look at the variable what I see is:
T:\CSDI\Projects\Library\002\8021889.doc#T:\CSDI\P rojects\Library\002\8021889.doc#

I'm assigning the string to the variable using:
strHyperlink = Me.txtDocLink

Is there a property of the hyperlink I should be using or do I have to
write code to trim the string?

Many thanks.
Keith.

Use HyperlinkPart. There is "what you display to the user" and then there
is the link. "DisplayThis"#http://www.microsoft.com# is a valid hyperlink

You can split them like
strD = HyperlinkPart(hyper,acDisplay)
strA = HyperlinkPart(hyper,acAddress)

Of course, you can use HyperlinkPart in queries but use the value of
acDisplay and acAddress. BTW, you can also use a subaddress if you need
to get that far.

The thing I detest about hyperlinks, using them in a datasheet or
continuous form, is that MS decided to make them link on a single click. I
think that MS should allow the developer to decide which click event
launches the link instead of making their, imo, flawed decisions. Now, it
wouldn't be so bad...the single link launch...but if you are tapping the
mouse here and there and you land on a hyperlink field or you want to edit
the hyperlink, you end up going to the link instead. I usually separate
the two and display only the display part to the user with the text in
blue underline. Then I can fire off the link on the event I want.


Excellent, thanks very much Salad.
Jan 18 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.