Add hyperlink field

H

Harley Feldman

I want to add a hyperlink to ADO records in one of the fields. I use the code below:

With rst
.AddNew
.Fields("Recipe") = RecipeName
.Fields("Type") = ""
.Fields("File") = "Recipes\" & RecipeName
.Update
End With

I am left with the correct address in the "File" field, and it looks like a hyperlink, but it is just a text string. How can I make the "File" field be a real hyperlink?

Harley
 
A

Allen Browne

You need to supply the display text as well as the address, and include the
#, e.g.:
.Fields("File") = RecipeName & "#Recipes\" & RecipeName & "#"

Explanation in:
Introduction to Hyperlink fields
at:
http://members.iinet.net.au/~allenbrowne/casu-09.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

I want to add a hyperlink to ADO records in one of the fields. I use the
code below:

With rst
.AddNew
.Fields("Recipe") = RecipeName
.Fields("Type") = ""
.Fields("File") = "Recipes\" & RecipeName
.Update
End With

I am left with the correct address in the "File" field, and it looks like a
hyperlink, but it is just a text string. How can I make the "File" field be
a real hyperlink?
 
Top