Hyperlink based on query result?

aranj

Registered User.
Local time
Today, 23:02
Joined
Feb 18, 2003
Messages
44
I'm trying in vain to correctly create a hyperlink from a query result.

I have a form based on the query result with a command button to do the search using Hyperlink address.

I'd like to search Companies House. The URL for a search is:

http://ws6info.companieshouse.gov.uk/info/do_search.cgi?id=&cname=blahrubbish&cnumb=&table=1

where blahrubbish is the company name to search for.

Obviously I'd like [name of company to search for] from the query result instead of blahrubbish.

Read the help, tried putting #s all over the place(!) but to no avail. I'm sure it's a simple one if anyone can help.

Thanks.
 


Dim strCompanyName As String
Dim strHLAddress As String


strCompanyName = DLookUp("YourFieldName","YourQueryName")
strHLAddress = "http://ws6info.companieshouse.gov.uk/info/do_search.cgi?id=&cname=" & strCompanyName & "&cnumb=&table=1"

Me.YourCommandButtonName.HyperLinkAddress = strHLAddress


Something like the above? :)
 
Many, many thanks.
I was trying to do it throught the hyperlink properties, but this works very well indeed.
Thanks again.
 
aranj said:
Many, many thanks.
I was trying to do it throught the hyperlink properties, but this works very well indeed.
Thanks again.

No worries :cool:
 

Users who are viewing this thread

Back
Top Bottom