Hyperlink not working

M

MarkB

I have a form with hyperlink fields in both the header and detail sections.
The hyperlinks in the detail section are bound to the form's data source (a
query) and they work fine.

The hyperlinks in the header are unbound, don't work, and are filled with
the following:

Venue_filter_hyp = HyperlinkPart(DLookup("[Web addr]", "Venues", "[Name] = "
& Chr(34) & Venue_filter.Text & Chr(34)), acAddress).

The cursor doesn't change to the hand on mouseover and the field behaves
like a text field.

Additionally, all of the fields are defined as tabstop = no and locked = yes.
 
J

John Nurick

Hi Mark,

Tables have fields, but forms don't. I guess that what you have is
-in the detail section of the form, textboxes bound to hyperlink fields
-in the header, unbound textboxes.

If a textbox is bound to a hyperlink field it automagically displays the
link with an underline and responds to mouseover and clicks like a
hyperlink on a web page. With an unbound textbox, you have to code this
behaviour yourself.

So you'd use HyperLinkPart(DLookup(...), acDisplayedValue) to get the
text to display in the textbox, and then in the Click event procedure
use something like

Application.FollowHyperlink HyperLinkPart(DLookup(...), acAddress)

to follow the link.

I have a form with hyperlink fields in both the header and detail sections.
The hyperlinks in the detail section are bound to the form's data source (a
query) and they work fine.

The hyperlinks in the header are unbound, don't work, and are filled with
the following:

Venue_filter_hyp = HyperlinkPart(DLookup("[Web addr]", "Venues", "[Name] = "
& Chr(34) & Venue_filter.Text & Chr(34)), acAddress).

The cursor doesn't change to the hand on mouseover and the field behaves
like a text field.

Additionally, all of the fields are defined as tabstop = no and locked = yes.
 
M

MarkB

That does the trick for following the hyperlink.

Now, how do I get the pointing hand to appear on mouse over.

Thanks

John Nurick said:
Hi Mark,

Tables have fields, but forms don't. I guess that what you have is
-in the detail section of the form, textboxes bound to hyperlink fields
-in the header, unbound textboxes.

If a textbox is bound to a hyperlink field it automagically displays the
link with an underline and responds to mouseover and clicks like a
hyperlink on a web page. With an unbound textbox, you have to code this
behaviour yourself.

So you'd use HyperLinkPart(DLookup(...), acDisplayedValue) to get the
text to display in the textbox, and then in the Click event procedure
use something like

Application.FollowHyperlink HyperLinkPart(DLookup(...), acAddress)

to follow the link.

I have a form with hyperlink fields in both the header and detail sections.
The hyperlinks in the detail section are bound to the form's data source (a
query) and they work fine.

The hyperlinks in the header are unbound, don't work, and are filled with
the following:

Venue_filter_hyp = HyperlinkPart(DLookup("[Web addr]", "Venues", "[Name] = "
& Chr(34) & Venue_filter.Text & Chr(34)), acAddress).

The cursor doesn't change to the hand on mouseover and the field behaves
like a text field.

Additionally, all of the fields are defined as tabstop = no and locked = yes.
 
R

Rob Oldfield

You can turn a standard label into a hyperlink by just doing:

me.lblName.HyperlinkAddress = "http://www.whatever.com"

and you'd probably also want:

me.lblName.FontUnderline = True
me.lblName.ForeColor = vbBlue



MarkB said:
That does the trick for following the hyperlink.

Now, how do I get the pointing hand to appear on mouse over.

Thanks

John Nurick said:
Hi Mark,

Tables have fields, but forms don't. I guess that what you have is
-in the detail section of the form, textboxes bound to hyperlink fields
-in the header, unbound textboxes.

If a textbox is bound to a hyperlink field it automagically displays the
link with an underline and responds to mouseover and clicks like a
hyperlink on a web page. With an unbound textbox, you have to code this
behaviour yourself.

So you'd use HyperLinkPart(DLookup(...), acDisplayedValue) to get the
text to display in the textbox, and then in the Click event procedure
use something like

Application.FollowHyperlink HyperLinkPart(DLookup(...), acAddress)

to follow the link.

I have a form with hyperlink fields in both the header and detail sections.
The hyperlinks in the detail section are bound to the form's data source (a
query) and they work fine.

The hyperlinks in the header are unbound, don't work, and are filled with
the following:

Venue_filter_hyp = HyperlinkPart(DLookup("[Web addr]", "Venues", "[Name] = "
& Chr(34) & Venue_filter.Text & Chr(34)), acAddress).

The cursor doesn't change to the hand on mouseover and the field behaves
like a text field.

Additionally, all of the fields are defined as tabstop = no and locked = yes.
 
M

MarkB

Thanks Rob.

It looks like I'll be changing my unbound text boxes with hyperlinks to
labels.

Rob Oldfield said:
You can turn a standard label into a hyperlink by just doing:

me.lblName.HyperlinkAddress = "http://www.whatever.com"

and you'd probably also want:

me.lblName.FontUnderline = True
me.lblName.ForeColor = vbBlue



MarkB said:
That does the trick for following the hyperlink.

Now, how do I get the pointing hand to appear on mouse over.

Thanks

John Nurick said:
Hi Mark,

Tables have fields, but forms don't. I guess that what you have is
-in the detail section of the form, textboxes bound to hyperlink fields
-in the header, unbound textboxes.

If a textbox is bound to a hyperlink field it automagically displays the
link with an underline and responds to mouseover and clicks like a
hyperlink on a web page. With an unbound textbox, you have to code this
behaviour yourself.

So you'd use HyperLinkPart(DLookup(...), acDisplayedValue) to get the
text to display in the textbox, and then in the Click event procedure
use something like

Application.FollowHyperlink HyperLinkPart(DLookup(...), acAddress)

to follow the link.

On Sat, 31 Dec 2005 05:27:03 -0800, "MarkB"

I have a form with hyperlink fields in both the header and detail sections.
The hyperlinks in the detail section are bound to the form's data source (a
query) and they work fine.

The hyperlinks in the header are unbound, don't work, and are filled with
the following:

Venue_filter_hyp = HyperlinkPart(DLookup("[Web addr]", "Venues", "[Name] = "
& Chr(34) & Venue_filter.Text & Chr(34)), acAddress).

The cursor doesn't change to the hand on mouseover and the field behaves
like a text field.

Additionally, all of the fields are defined as tabstop = no and locked = yes.
 
J

John Nurick

Thanks, Rob. I never knew that.

You can turn a standard label into a hyperlink by just doing:

me.lblName.HyperlinkAddress = "http://www.whatever.com"

and you'd probably also want:

me.lblName.FontUnderline = True
me.lblName.ForeColor = vbBlue



MarkB said:
That does the trick for following the hyperlink.

Now, how do I get the pointing hand to appear on mouse over.

Thanks

John Nurick said:
Hi Mark,

Tables have fields, but forms don't. I guess that what you have is
-in the detail section of the form, textboxes bound to hyperlink fields
-in the header, unbound textboxes.

If a textbox is bound to a hyperlink field it automagically displays the
link with an underline and responds to mouseover and clicks like a
hyperlink on a web page. With an unbound textbox, you have to code this
behaviour yourself.

So you'd use HyperLinkPart(DLookup(...), acDisplayedValue) to get the
text to display in the textbox, and then in the Click event procedure
use something like

Application.FollowHyperlink HyperLinkPart(DLookup(...), acAddress)

to follow the link.

On Sat, 31 Dec 2005 05:27:03 -0800, "MarkB"

I have a form with hyperlink fields in both the header and detail sections.
The hyperlinks in the detail section are bound to the form's data source (a
query) and they work fine.

The hyperlinks in the header are unbound, don't work, and are filled with
the following:

Venue_filter_hyp = HyperlinkPart(DLookup("[Web addr]", "Venues", "[Name] = "
& Chr(34) & Venue_filter.Text & Chr(34)), acAddress).

The cursor doesn't change to the hand on mouseover and the field behaves
like a text field.

Additionally, all of the fields are defined as tabstop = no and locked = yes.
 
Top