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!

Using VBA to insert a hyperlink

Status
Not open for further replies.

PortyAL

Technical User
May 13, 2005
126
GB
Hi

I'm trying to use VBA (the HyperlinkPart function to be precise)to insert a hyperlink into a hyperlink field in a form.

I am trying the following code:

Code:
Forms![events log]!Link = HyperlinkPart("c:\folder\filename.doc", acAddress)
Forms![events log]!Link = HyperlinkPart("file", acDisplayedtext)

where "link" is the hyperlink field.

The acDisplayedText line works OK, but I cannot get the document path inserted. It is always blank.

Any advice would be appreciated.

Thanks

AL
 
HyperlinkPart returns values, not sets them.

The early bird may get the worm, but the second mouse gets the cheese in the trap.
 
Thanks

Any ideas how to set the values?

AL
 
Assuming you mean set the value in the underlying table, it is the same as updating or inserting any other field; just happens to be a different datatype.

Always remember that you're unique. Just like everyone else.
 
Have you tried this ?
Forms![events log]!Link = "file#c:\folder\filename.doc#"

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Many thanks - had left out the # arround the path.

AL
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top