Dynamic hyperlinks including field value?

G

Guest

Hello,

I'd like to do the following:
- I have a table with a field called, say, "param", containing a numeric
value.
- when displaying records, a click on this field should
a) use the value of "param" to build an internet address in the style of:
"http://my.site.com/appli.dll?query=xxx" where xxx is the specific value of
the param field for this record, the rest of the link being the same for all
records
b) use this dynamically assembled address to open a browser window.

Thank you in advance to advise...

Kind regards,

Renaud Dainville, Brussels
 
G

Guest

You should be able to do this with a little coding using the followhyperlink
Method.

Try something like

Using a form in which you have a control named param which houses the param
value for the record in question you could simply do

Application.FollowHyperlink "http://my.site.com/appli.dll?query=" & Me.param
 
G

Guest

Hello Daniel,

Thank you for pointing the right direction to me.

I have to say I'm pretty novice in VB...

Can you please be a bit more specific on the coding, especially how to
"capture" the field value and store it in the variable that will be inserted
in the http address? Thans a lot in advance!

rgds

Renaud
 
G

Guest

Renaud,

Don't worry about being a novice. We've were all there (and still are
learning). That's the point of these forums. There is no such thing as a
dumb question!

Application.FollowHyperlink "http://my.site.com/appli.dll?query=" & Me.param

in the case above there is no need to store the value as a variable, as the
value is directly passed to the Method. The Me.Param is pulling the current
record's value of the control named Param from the form and using it directly
to generate the URL. So as you navigate from one record to another its value
will be updated with the value associate with the Param control value for
that record.

If you really wish to assign its value to a variable then a slight mod is
required, try something like

Dim strParam as String
strParam=Me.Param 'Storing the value of the form control named Param as a
variable named strParam
Application.FollowHyperlink "http://my.site.com/appli.dll?query=" & strParam

Did this clarify, or did I misunderstand your question?
--
Hope this helps,

Daniel P
 
G

Guest

Hello Daniel,

Thanks a lot for the extra details. Exactly what I needed. It works
perfectly!

Kind regards,

Renaud
 
G

Guest

Now I feel REALLY dumb. This is exactly what I am trying to do, but I don't
understand where in the form design do you put the
Application.FollowHyperlink "http://my.site.com/appli.dll?query=" &
Me.param
I have a textBox with the Control Source of param. Do I put that line in
the Event On Dbl Click for the Text Box with that Control Source while having
that Text Box Format Is Hyperlink as yes? I get an error of Cannot Find
Macro Application. I am obviously missing something VERY basic.

Thanks for your help.
 

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