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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using VBA to set an Access Hyperlink Field 1

Status
Not open for further replies.

RikHess

MIS
Jul 25, 2002
69
US
I am trying to programmatically build the hyperlink Display_Text and Address for records as they are processed.

I have a hyperlink type field named "Link" in the table.

Using an ADODB recSet, I am trying to assign values to this field so that the field will display "GoTo_Link" and the URL would be "file:///C:\MyFolder\Sonefile.txt".

This does not work:
recSet.Fields("Link") = HyperlinkPart("GoTo_Link", acDisplayText)
recSet.Fields("Link") = HyperlinkPart("file:///C:\MyFolder\Sonefile.txt", acAddress)


Does someone have an answer? Any help is appreciated. TIA!

 
A Hyperlink field is nothing more than a Memo field with special formatting. The separate parts of the link are separated by hash marks:
[tt]
DisplayName#Address[?Subject]#SubAddress##ScreenTip
[/tt]
Code:
recSet.Fields("Link") = "GoTo_Link#file:///C:\MyFolder\Sonefile.txt#"

VBSlammer
redinvader3walking.gif

"You just have to know which screws to turn." - Professor Bob
 
And that's why I love Professor Bob's motto: "You just have to know which screws to turn." [lol]

VBSlammer
redinvader3walking.gif

"You just have to know which screws to turn." - Professor Bob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top