By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,967 Members | 1,267 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,967 IT Pros & Developers. It's quick & easy.

Anyway to remove #hyperlink# from .Value Property?

rsmccli
P: 52
Hello,

Using Access 2002

I have a function that will accept a path to a document as a string, then open and print it. I have a table (tblScopeHyperlinks) that saves all hyperlinks inputted from a subform's (frmScopeHyperlinks) textbox.I have been trying to make a command button that will loop through all of these hyperlink records in the table, with the value of each entry as the variable (path to document).

My problem is that the .Value of a hyperlink is always returned as :

C:\folder\document.doc#C:\folder\document.doc#

and so the address is not right.

So:
Is there a property that will return just the text name of a hyperlink?

I have also tried adding a "Text Link Adress" field in the table so there would be a normal text version of each hyperlink. This updates from additional textbox on the subform that will copy the .Value when a hyperlink is inputted. This, of course, also updates as above.

Any ideas would be welcome, thanks

rsmccli
Jan 31 '08 #1
Share this Question
Share on Google+
2 Replies


ADezii
Expert 5K+
P: 8,679
Hello,

Using Access 2002

I have a function that will accept a path to a document as a string, then open and print it. I have a table (tblScopeHyperlinks) that saves all hyperlinks inputted from a subform's (frmScopeHyperlinks) textbox.I have been trying to make a command button that will loop through all of these hyperlink records in the table, with the value of each entry as the variable (path to document).

My problem is that the .Value of a hyperlink is always returned as :

C:\folder\document.doc#C:\folder\document.doc#

and so the address is not right.

So:
Is there a property that will return just the text name of a hyperlink?

I have also tried adding a "Text Link Adress" field in the table so there would be a normal text version of each hyperlink. This updates from additional textbox on the subform that will copy the .Value when a hyperlink is inputted. This, of course, also updates as above.

Any ideas would be welcome, thanks

rsmccli
To return the Hyperlink Address from a Text Field named txtHyperlink on a Form:
Expand|Select|Wrap|Line Numbers
  1. Dim HLink As Hyperlink
  2.  
  3. Set HLink = Me![txtHyperlink].Hyperlink
  4. MsgBox HLink.Address
Jan 31 '08 #2

rsmccli
P: 52
I used Mid and InStr to extract the address only from the hyperlink value.
Expand|Select|Wrap|Line Numbers
  1. '....
  2.  
  3.   With rs
  4.     rs.MoveFirst
  5.     Do Until rs.EOF
  6.       strDocumentPath = Mid(rs.Fields("hyplink"), 1, (InStr(rs.Fields("hypLink"), "#") - 1))
  7.       Call ExecuteFile(strDocumentPath, "Print")
  8.     rs.MoveNext
  9.     Loop
  10.   End With
Thank you very much for your reply.
Jan 31 '08 #3

Post your reply

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