From: Bernie on
I added a combo box with values that I would like to pick up in the Hyperlink
TextToDisplay of a hyperlink field.

In the After Update event of the combo box, I added:
Me.(myfield).SetFocus
RunCommand accmdInsertHyperlink

What is the command to then pick up the combo box value in the Text to
Display? I tried adding line:
Me.(myfield).Hyperlink.Texttodisplay = Me.(combobox)

I get an error: Run-Time Error 7980
The HyperlinkAddress or HyperlinkSubAddress property is read-only for this
hyperlink.
From: John Nurick on
Hi Bernie,

Don't bother with DoCmd.InsertHyperlink. Instead, open a table that has
a hyperlink field in it, tab into the hyperlink field, and hit F2.
You'll see the actual contents of the field, which may be just the
address, e.g. http://www.microsoft.com, or display text and address
separated by #, e.g.
MSFT#http://www.microsoft.com
plus maybe a sub-address separated by another #.

What you need to do is to build similar strings. So you might do
something like

Dim strURL As String

strURL = "http://www.microsoft.com" 'or get the address
'some other way

Me.MyField.Value = strURL & "#" & Me.Combobox.Value




On Thu, 10 Feb 2005 22:43:03 -0800, Bernie
<Bernie(a)discussions.microsoft.com> wrote:

>I added a combo box with values that I would like to pick up in the Hyperlink
>TextToDisplay of a hyperlink field.
>
>In the After Update event of the combo box, I added:
>Me.(myfield).SetFocus
>RunCommand accmdInsertHyperlink
>
>What is the command to then pick up the combo box value in the Text to
>Display? I tried adding line:
>Me.(myfield).Hyperlink.Texttodisplay = Me.(combobox)
>
>I get an error: Run-Time Error 7980
>The HyperlinkAddress or HyperlinkSubAddress property is read-only for this
>hyperlink.

--
John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.