Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

hyperlinking in Access

Status
Not open for further replies.

pacitti

Technical User
Nov 8, 2002
2
GB
I am in need of help with VBA in Access 2000.

I am creating a forum with Albums info from Amazon. I need to put a link on the forum so that as you are browsing the forum and you like or find the CD you want to buy, you can click on the link on that page and it would take you to the corresponding Amazon page. Each record has a ID called a ASIN number so al I need to do is create a link that will change the ASIN part in the link as I browse the forum.

I was suggested using a record set like this but I can seem to get it to work.

strLink = " + rs.Fields("asin") + "/qid=1036750045/sr=8-1/ref=sr_8_1/102-7744387-4978558?v=glance&s=music&n=507846"

If you are not sure what I am asking then look at my html explanation that has pics in it to help you understand what I need done.

(Login as gust)

I need this done by Thursday of next week so I would be REALLY grateful if someone could help me. Thank you :)
 
Hi Pac,

You haven't said exactly why it won't work, but ......

1)In your strLink assignment string you have a semi-colon that shouldn't be there.

2)If the above string does contain a correct hyperlink string then command buttons, labels and images have 'hyperlink address' properties. Are you assigning strLink to these properties?

3)To get more detailed info; try a search in Access help for 'hyperlink'.

Hope this helps some,

Regards,

Darrylle "Never argue with an idiot, he'll bring you down to his level - then beat you with experience."
 
Put a command button on your form and set its Hyperlink address in the form's OnCurrent() event:
Code:
Private Sub Form_Current()
  Me.cmdGo.HyperlinkAddress = GetLink()
End Sub

Add this function:

Code:
Function GetLink() As String

  Dim strPrefix    As String
  Dim strPostfix   As String
  Dim strASIN      As String

  strASIN = Nz(Me.ASIN, "")

  If Len(strASIN) = 0 Then Exit Function

  strPrefix = "[URL unfurl="true"]http://www.amazon.com/exec/obidos/tg/detail/-/"[/URL]
  
  strPostfix = "/qid=1036750045/sr=8-1/ref=sr_8_1/102-7744387-4978558?v=glance&s=music&n=507846"

  GetLink = strPrefix & strASIN & strPostfix

End Function
VBSlammer
redinvader3walking.gif

Unemployed in Houston, Texas
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top