Gasman
Enthusiastic Amateur
- Local time
- Today, 16:57
- Joined
- Sep 21, 2011
- Messages
- 16,671
Ok, lets try and start from the beginning.
Why are you copying and pasting to the clipboard, as a hyperlink is meant to take you to that link directly.?
I have not used hyperlink fields myself yet, but I remember someone posting that it comes in two parts, one that is the text shown, and the other the actual link?
Found it
From this thread https://www.access-programmers.co.uk/forums/showthread.php?t=302051&highlight=hyperlink post #3, that confirms my memory.
Arne solved it with Split(), and we can use that to solve both problems, whether you have the description and link or just the link
and while we are on the subject of #, please use the # icon above the editing window before pasting code. this then places it in code blocks and makes it easier to read.
HTH
Why are you copying and pasting to the clipboard, as a hyperlink is meant to take you to that link directly.?
I have not used hyperlink fields myself yet, but I remember someone posting that it comes in two parts, one that is the text shown, and the other the actual link?
Found it
From this thread https://www.access-programmers.co.uk/forums/showthread.php?t=302051&highlight=hyperlink post #3, that confirms my memory.
Arne solved it with Split(), and we can use that to solve both problems, whether you have the description and link or just the link
Code:
Private Sub Vendor_Website_Click()
' = = = K copy button
' = = = Source of data = Vendor_Contacts_VC_WebSite
If Nz(Me.Vendor_Contacts_VC_WebSite, "") <> "" Then
'Me.Vendor_Contacts_VC_WebSite = Replace(Me.Vendor_Contacts_VC_WebSite, "#", "")
[COLOR="Red"]Me.Vendor_Contacts_VC_WebSite = Split(Me.Vendor_Contacts_VC_WebSite, "#")(1)[/COLOR]
With Me.Vendor_Contacts_VC_WebSite
.SetFocus
.SelStart = 0
.SelLength = Len(.Text)
End With
DoCmd.RunCommand acCmdCopy
'MsgBox "Text Copied into Memory"
Else
MsgBox "There is no text for copying"
End If
End Sub
and while we are on the subject of #, please use the # icon above the editing window before pasting code. this then places it in code blocks and makes it easier to read.
HTH
Last edited: