hyperlink using field date to build address

G

Guest

Each record in my database has a field where the ISBN number of a particular
book is stored. I want to build a hyperlink that will take me to my library's
catalogue with a book's details.

How do I build a hyperlink that opens Explorer whose address is
(http://kea.massey.ac.nz/search/i?X), where 'X' is the ISBN number in
whatever record I choose to click the link from?

Apologies if this is not clear. Thanks in advance!
 
J

John Nurick

Hi David,

If you're thinking in terms of using a hyperlink field, don't. Use
something like

Const URL_BASE = "http://kea.massey.ac.nz/search/i?"
Dim strISBN As String

'Encode any spaces in ISBN
strISBN = Replace(Me.txtISBN.Value, " ", "%20")

Application.FollowHyperlink URL_BASE & strISBN

where txtISBN is the name of the textbox on your form that displays the
ISBN. Call it from the double-click event of txtISBN, or the click event
of a commandbutton; or if you want to use a single click in txtISBN make
sure that it's formatted blue and underlined to it looks like a
hyperlink.
 

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