I'm struggling with some code to update Hyperlinks in my table. The field is defined as a Hyperlink and is editable without problem from the interface (I open the table for display, right-click on an item and select Hyperlink / Edit Hyperlink and all is fine).
The table is defined very simply as :
Table = tblLink
Expand|Select|Wrap|Line Numbers
- Field Type Index
- LinkID Autonumber PK
- Link Hyperlink
Form = tblLinkEdit
Expand|Select|Wrap|Line Numbers
- Control Type Bound
- txtLinkID TextBox Y
- txtDescription TextBox
- txtHTTP TextBox
- txtLink TextBox Y
The code for the update (AfterUpdate of both of the unbound TextBoxes) is as follows (txtLink is designed as locked so no-one tries to edit it in place) :
Expand|Select|Wrap|Line Numbers
- Private Sub txtDescription_AfterUpdate()
- Call UpdateLink
- End Sub
- Private Sub txtHTTP_AfterUpdate()
- Call UpdateLink
- End Sub
- Private Sub UpdateLink()
- With Me.txtLink
- .Locked = False
- .Value = Me.txtDescription
- .Hyperlink.Address = Me.txtHTTP
- .Locked = True
- End With
- End Sub
When it gets to line #13 the error message of the title pops up :
Error 7980: The HyperlinkAddres s or HyperlinkSubAdd ress property is read-only for this hyperlink
NB. I find it particularly confusing as the property I'm attempting to assign is neither of those of course.
I'd be grateful for any sort of assistance. If anyone can simply point me to where to look that would be fine.