Programmatically assign a value to a hyperlink field in Access 200

G

Guest

Hi,

I am trying to assign a value to both the visibile value and the address of
a hyperlink field in a table in Access 2003. I am using the fillowing
attributes:

rsappend.link.Caption = rs.Fields("Link")
rsappend.link.HyperlinkAddress = rs.Fields("Link")
rsappend.Update

The rs.fields("link") is a text string pulling its value from another table
according toa certain complicated criteria...

These two attribultes are not working... I don't get any error but my tablem
which I am appending ends up with hundreds of empty records!!!

Any help here??

Thanks

Einy.
 
J

John Nurick

Hi Einy,

IMHO the simplest way to assign values to a hyperlink field under
program control is to assemble a string containing the required parts
and then assign it to the field's Value property (or use it in an update
query).

The string can have up to four parts as follows:
displaytext#address#subaddress#screentip

E.g.
My Website#http://www.mywebsite.com/index.html

So if you have a value in rs.Fields("Link") and you want to use it as
both the displaytext and the address of a hyperlink field, you may be
able to use something like this:

strNewValue = rs.Fields("Link") & "#" & rs.Fields("Link")

although if the existing value is a URL that contains a subaddress (e.g.

http://mywebsite.com/folder/somepage.html#bookmark

) you'll need to replace the # with something else in the displaytext
section .
 
G

Guest

Thanks John,

That'll do the trick for now since all my links are UNC intranet links..

Cheers.
 

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