473,386 Members | 1,924 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Error 7980: HyperlinkAddress or HyperlinkSubAddress read-only for Hyperlink

NeoPa
32,556 Expert Mod 16PB
Error 7980: The HyperlinkAddress or HyperlinkSubAddress property is read-only for this hyperlink

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
  1. Field   Type        Index
  2. LinkID  Autonumber  PK
  3. Link    Hyperlink
I run into problems however, when I try to update (or even add a new one from scratch) this item on my form. The form is laid out as :
Form = tblLinkEdit
Expand|Select|Wrap|Line Numbers
  1. Control         Type    Bound
  2. txtLinkID       TextBox   Y
  3. txtDescription  TextBox
  4. txtHTTP         TextBox
  5. txtLink         TextBox   Y
The operator fills in both of the unbound TextBoxes, then the code should create a Hyperlink in txtLink from what's entered.

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
  1. Private Sub txtDescription_AfterUpdate()
  2.     Call UpdateLink
  3. End Sub
  4.  
  5. Private Sub txtHTTP_AfterUpdate()
  6.     Call UpdateLink
  7. End Sub
  8.  
  9. Private Sub UpdateLink()
  10.     With Me.txtLink
  11.         .Locked = False
  12.         .Value = Me.txtDescription
  13.         .Hyperlink.Address = Me.txtHTTP
  14.         .Locked = True
  15.     End With
  16. End Sub
I've tried various other ways of approaching this problem but as none of them has shown any success, I won't bore you with the details. Suffice to say I tried editing the existing Hyperlink as well as attempting to build it from scratch as in this code.

When it gets to line #13 the error message of the title pops up :
Error 7980: The HyperlinkAddress or HyperlinkSubAddress 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.
Oct 10 '09 #1

✓ answered by NeoPa

Although this particular problem is still confusing me, I did eventually find (by looking differently) something that helped me to do what I needed without accessing the .Hyperlink property directly.

The page I found (Introduction to Hyperlink fields) was from Allen Browne's site. The concept is simply to set the .Value of the TextBox to a three way string comprising Description#Link#Sublink (Sublink optional).

My final code is :
Expand|Select|Wrap|Line Numbers
  1. Private Sub UpdateLink()
  2.     With Me
  3.         .txtLink.Locked = False
  4.         '+ used with strings resolves to Null if any element is Null.
  5.         Select Case "" + .txtDescription + .txtHTTP
  6.         Case Null
  7.             .txtLink = .txtDescription & .txtHTTP
  8.         Case Else
  9.             .txtLink = .txtDescription & "#" & Me.txtHTTP & "#"
  10.         End Select
  11.         .txtLink.Locked = True
  12.     End With
  13. End Sub
The best part of it all is - It works!

1 9768
NeoPa
32,556 Expert Mod 16PB
Although this particular problem is still confusing me, I did eventually find (by looking differently) something that helped me to do what I needed without accessing the .Hyperlink property directly.

The page I found (Introduction to Hyperlink fields) was from Allen Browne's site. The concept is simply to set the .Value of the TextBox to a three way string comprising Description#Link#Sublink (Sublink optional).

My final code is :
Expand|Select|Wrap|Line Numbers
  1. Private Sub UpdateLink()
  2.     With Me
  3.         .txtLink.Locked = False
  4.         '+ used with strings resolves to Null if any element is Null.
  5.         Select Case "" + .txtDescription + .txtHTTP
  6.         Case Null
  7.             .txtLink = .txtDescription & .txtHTTP
  8.         Case Else
  9.             .txtLink = .txtDescription & "#" & Me.txtHTTP & "#"
  10.         End Select
  11.         .txtLink.Locked = True
  12.     End With
  13. End Sub
The best part of it all is - It works!
Oct 10 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: John F Dutcher | last post by:
Can anyone comment on why the code shown in the Python error is in some way incorrect...or is there a problem with Python on my hoster's site ?? The highlites don't seem to show here...but line...
0
by: Morten Gulbrandsen | last post by:
mysql> USE company; Database changed mysql> mysql> DROP TABLE IF EXISTS EMPLOYEE; -------------- DROP TABLE IF EXISTS EMPLOYEE -------------- Query OK, 0 rows affected (0.00 sec)
4
by: Bill Cohagan | last post by:
I'm writing a console app in c# and am encountering a strange problem. I'm trying to use redirection of the standard input stream to read input from a (xml) file. The following code snippet is from...
2
by: GB | last post by:
Hi Everybody! I have 2 different processes/application. One is writing to a file and another is reading from it. For some reason the code doesnt seems to work and gives mscorlib.dll IOException...
3
by: James | last post by:
Hi, I am developing a ActiveX Control which will be used in a web page. The control will encrypt some value then decrypt it when the web page opens next time. I tested the control in a windows...
6
by: Nakhi | last post by:
Hi, my code is very simple. dim cm as oledbcommand= new oledbcommand("select * from page " ,cn) cn.open() Dim dr As OleDbDataReader = cm.ExecuteReader() dim cate=dr.getstring(1) 'error line"...
8
by: mohit | last post by:
Hi, I am creating a web application in Web Matrix on the .NET framework. I have two directories :AddUser and FormAuth in a Directory P. AddUser contains a file AddUser.aspx FormAuth contains :...
2
by: dasilva109 | last post by:
Hi guys I am new to C++ and need urgent help with this part of my code for a uni coursework I have to submit by Thursday //ClientData.h #ifndef CLIENTDATA_H #define CLIENTDATA_H #include...
2
by: arun1985 | last post by:
In the project i am using i am having the following code and when i upload it to the server.Its givig me the following error in the global.cs file. Server Error in '/' Application. ...
0
by: .nLL | last post by:
Erorr is --------------------- Microsoft VBScript runtime error '800a0046' Permission denied /a.asp, line 3 -----------------------
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.