Hyperlink and column lookup

G

Guest

Hello,

I have a form in which there is a combo box to select a report. The query
that [populates the combo box pulls in data from the reports table, like
"ReportTitle" and "LinkToFile". I then have a text box with its source set to
"=ReportName.column(4)" When this field populates from the selection in the
combo box, it shows up as "hyperlink here#http://hyperlink here#", but does
not show up as the hand to allow me to click and go to the file like it does
on a form that references the table with the hyperlink in it directly.

Is there any way to populate a hyperlink into a text box from a column in a
combo box and have it work? I read some previous replies and set the
"IsHyperlink" value to yes, but then it just LOOKS like a hyperlink, but has
no functionality.

Any and all help would be greatly appreciated...
~MATT
 
G

Guest

Hi, Matt.

An unbound text box is unable to use the Hyperlink class, so it only
displays the text values of the three Hyperlink properties. However, an
unattached label can use the Hyperlink class. And since you are using a
combo box to display the value from the query, I suspect you'll have the same
problem since it's unbound. You might try using DLookup( ) for the table
based upon the value in the fifth column of the query that populates the
combo box. For example:

Me!lblLink.HyperlinkAddress = _
Application.HyperlinkPart(DLookup("HypLink", "tblHyperlinks", _
"ID = " & Me!ReportName.Column(0)), acAddress)
Me!lblLink.HyperlinkSubAddress = _
Application.HyperlinkPart(DLookup("HypLink", "tblHyperlinks", _
"ID = " & Me!ReportName.Column(0)), acSubAddress)
Me!lblLink.Caption = _
Application.HyperlinkPart(DLookup("HypLink", "tblHyperlinks", _
"ID = " & Me!ReportName.Column(0)), acDisplayText)

.... where lblLink is the unattached label, ReportName is the combo box,
HypLink name of the Hyperlink field in tblHyperlinks table, and ID is the
first column in the query and the primary key of the tblHyperlinks table.

HTH.

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address, so that a message
will be forwarded to me.)
Beware to those who use munged addresses: known newsgroup E-mail harvesters
for spammers are (e-mail address removed) and (e-mail address removed)

- - -
When you see correct answers to your question posted in Microsoft's Online
Community, please sign in to the Community and mark these posts as "Answers,"
so that all may benefit by filtering on "Answered questions" and quickly
finding the right answers to similar questions. Remember that the first and
best answers are often given to those who have a history of rewarding the
contributors who have taken the time to answer questions correctly.


Melvis said:
Hello,

I have a form in which there is a combo box to select a report. The query
that [populates the combo box pulls in data from the reports table, like
"ReportTitle" and "LinkToFile". I then have a text box with its source set to
"=ReportName.column(4)" When this field populates from the selection in the
combo box, it shows up as "hyperlink here#http://hyperlink here#", but does
not show up as the hand to allow me to click and go to the file like it does
on a form that references the table with the hyperlink in it directly.

Is there any way to populate a hyperlink into a text box from a column in a
combo box and have it work? I read some previous replies and set the
"IsHyperlink" value to yes, but then it just LOOKS like a hyperlink, but has
no functionality.

Any and all help would be greatly appreciated...
~MATT
 
G

Guest

Great! Just what I needed! I had a bit of debugging hell dur to the fact that
my primary key filed in the table is text as opposed to a number, so I ended
up with:

Me!lblLink.HyperlinkAddress = _
Application.HyperlinkPart(DLookup("LinkToFile", "tblFormNames", _
"FormNameID = '" & Me.cboFormName.Column(0) & "'"), acAddress)
Me!lblLink.HyperlinkSubAddress = _
Application.HyperlinkPart(DLookup("LinkToFile", "tblFormNames", _
"FormNameID = '" & Me!cboFormName.Column(0) & "'"), acSubAddress)
Me!lblLink.Caption = _
Application.HyperlinkPart(DLookup("LinkToFile", "tblFormNames", _
"FormNameID = '" & Me!cboFormName.Column(0) & "'"), acDisplayText)

Took me a bit to realize the error I was getting was because I was missing
the single quotes around the cloumn lookup from the combo, but that was my
fault for not specifying the data type in the original post. Thanks again!

Sorry I didn't get to try this yesterday - I saw your post after I left
work...

'69 Camaro said:
Hi, Matt.

An unbound text box is unable to use the Hyperlink class, so it only
displays the text values of the three Hyperlink properties. However, an
unattached label can use the Hyperlink class. And since you are using a
combo box to display the value from the query, I suspect you'll have the same
problem since it's unbound. You might try using DLookup( ) for the table
based upon the value in the fifth column of the query that populates the
combo box. For example:

Me!lblLink.HyperlinkAddress = _
Application.HyperlinkPart(DLookup("HypLink", "tblHyperlinks", _
"ID = " & Me!ReportName.Column(0)), acAddress)
Me!lblLink.HyperlinkSubAddress = _
Application.HyperlinkPart(DLookup("HypLink", "tblHyperlinks", _
"ID = " & Me!ReportName.Column(0)), acSubAddress)
Me!lblLink.Caption = _
Application.HyperlinkPart(DLookup("HypLink", "tblHyperlinks", _
"ID = " & Me!ReportName.Column(0)), acDisplayText)

... where lblLink is the unattached label, ReportName is the combo box,
HypLink name of the Hyperlink field in tblHyperlinks table, and ID is the
first column in the query and the primary key of the tblHyperlinks table.

HTH.

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address, so that a message
will be forwarded to me.)
Beware to those who use munged addresses: known newsgroup E-mail harvesters
for spammers are (e-mail address removed) and (e-mail address removed)

- - -
When you see correct answers to your question posted in Microsoft's Online
Community, please sign in to the Community and mark these posts as "Answers,"
so that all may benefit by filtering on "Answered questions" and quickly
finding the right answers to similar questions. Remember that the first and
best answers are often given to those who have a history of rewarding the
contributors who have taken the time to answer questions correctly.


Melvis said:
Hello,

I have a form in which there is a combo box to select a report. The query
that [populates the combo box pulls in data from the reports table, like
"ReportTitle" and "LinkToFile". I then have a text box with its source set to
"=ReportName.column(4)" When this field populates from the selection in the
combo box, it shows up as "hyperlink here#http://hyperlink here#", but does
not show up as the hand to allow me to click and go to the file like it does
on a form that references the table with the hyperlink in it directly.

Is there any way to populate a hyperlink into a text box from a column in a
combo box and have it work? I read some previous replies and set the
"IsHyperlink" value to yes, but then it just LOOKS like a hyperlink, but has
no functionality.

Any and all help would be greatly appreciated...
~MATT
 
6

'69 Camaro

You're welcome! And thanks for marking my reply as an answer. It's much
appreciated!
I had a bit of debugging hell dur to the fact that
my primary key filed in the table is text as opposed to a number

Another reason that many experienced database developers use AutoNumber
surrogate keys: zero debugging time whenever the text string delimiters are
forgotten in the SQL syntax, since string delimiters are never needed for
numbers.

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address, so that a message
will be forwarded to me.)
Beware to those who use munged addresses: known newsgroup E-mail harvesters
for spammers are (e-mail address removed) and (e-mail address removed)


Melvis said:
Great! Just what I needed! I had a bit of debugging hell dur to the fact
that
my primary key filed in the table is text as opposed to a number, so I
ended
up with:

Me!lblLink.HyperlinkAddress = _
Application.HyperlinkPart(DLookup("LinkToFile", "tblFormNames", _
"FormNameID = '" & Me.cboFormName.Column(0) & "'"), acAddress)
Me!lblLink.HyperlinkSubAddress = _
Application.HyperlinkPart(DLookup("LinkToFile", "tblFormNames", _
"FormNameID = '" & Me!cboFormName.Column(0) & "'"), acSubAddress)
Me!lblLink.Caption = _
Application.HyperlinkPart(DLookup("LinkToFile", "tblFormNames", _
"FormNameID = '" & Me!cboFormName.Column(0) & "'"), acDisplayText)

Took me a bit to realize the error I was getting was because I was missing
the single quotes around the cloumn lookup from the combo, but that was my
fault for not specifying the data type in the original post. Thanks again!

Sorry I didn't get to try this yesterday - I saw your post after I left
work...

'69 Camaro said:
Hi, Matt.

An unbound text box is unable to use the Hyperlink class, so it only
displays the text values of the three Hyperlink properties. However, an
unattached label can use the Hyperlink class. And since you are using a
combo box to display the value from the query, I suspect you'll have the
same
problem since it's unbound. You might try using DLookup( ) for the table
based upon the value in the fifth column of the query that populates the
combo box. For example:

Me!lblLink.HyperlinkAddress = _
Application.HyperlinkPart(DLookup("HypLink", "tblHyperlinks", _
"ID = " & Me!ReportName.Column(0)), acAddress)
Me!lblLink.HyperlinkSubAddress = _
Application.HyperlinkPart(DLookup("HypLink", "tblHyperlinks", _
"ID = " & Me!ReportName.Column(0)), acSubAddress)
Me!lblLink.Caption = _
Application.HyperlinkPart(DLookup("HypLink", "tblHyperlinks", _
"ID = " & Me!ReportName.Column(0)), acDisplayText)

... where lblLink is the unattached label, ReportName is the combo box,
HypLink name of the Hyperlink field in tblHyperlinks table, and ID is the
first column in the query and the primary key of the tblHyperlinks table.

HTH.

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address, so that a message
will be forwarded to me.)
Beware to those who use munged addresses: known newsgroup E-mail
harvesters
for spammers are (e-mail address removed) and (e-mail address removed)

- - -
When you see correct answers to your question posted in Microsoft's
Online
Community, please sign in to the Community and mark these posts as
"Answers,"
so that all may benefit by filtering on "Answered questions" and quickly
finding the right answers to similar questions. Remember that the first
and
best answers are often given to those who have a history of rewarding the
contributors who have taken the time to answer questions correctly.


Melvis said:
Hello,

I have a form in which there is a combo box to select a report. The
query
that [populates the combo box pulls in data from the reports table,
like
"ReportTitle" and "LinkToFile". I then have a text box with its source
set to
"=ReportName.column(4)" When this field populates from the selection in
the
combo box, it shows up as "hyperlink here#http://hyperlink here#", but
does
not show up as the hand to allow me to click and go to the file like it
does
on a form that references the table with the hyperlink in it directly.

Is there any way to populate a hyperlink into a text box from a column
in a
combo box and have it work? I read some previous replies and set the
"IsHyperlink" value to yes, but then it just LOOKS like a hyperlink,
but has
no functionality.

Any and all help would be greatly appreciated...
~MATT
 

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