# Before & After Web Address #

I haven't looked at your database
Just use an update query
In the field name concerned , use update to : Replace([FieldName],"#","")
 
As Colin states, use the Replace command in the event for the button where you have the rest of your code.
 
Thank you for your suggestions, but I can not get the # Symbol out of the web address, in a Hyperlink field,
The code that we use is shown below.
===
Private Sub Vendor_Website_Click()
If Nz(Me.Vendor_Contacts_VC_WebSite, "") <> "" Then
With Me.Vendor_Contacts_VC_WebSite
.SetFocus
.SelStart = 0
.SelLength = Len(.Text)
End With
DoCmd.RunCommand acCmdCopy
Else
MsgBox "There is no text for copying"
End If
End Sub
===
Every Web Address being copied has a Beginning and trailing # Symbol,
example (#www.microsoft.com/en-ca#)
How would you suggest to remove the # signs?
===
Thank you
Apple
 
Have you or anyone else in your group actually tried what I suggested in post #2? It will work
 
Hi Apple. Why are you copying the web address? Is the user supposed to paste it somewhere? If so, you don’t really want to remove the # from the table, just not have it copied for pasting.
 
Thank you, theDBguy.
Yes, we are copying the web address from a "Hyperlink" field into the Browser Address Bar, as some of the Secure Websites that we are using do not allow a Hyperlink Click and copying the address adds the symbols "#"

BUT if we copy the Web Address from a "Text" field the "#" symbol does not appear.

Thank you for your questions.
Nicole
 
Thank you,isladogs
Yes we have tried your suggestion, which works for a text field but does not work in the Hypelink Field.
I do appreciate your suggestion.

Nicole
 
Hi Nicole. Thank you for the clarification. So, what we could try to do is probably add an unbound textbox we can use for the copy and paste operation. You can assign a value into this textbox using an expression in the control source. Here’s one example.
Code:
=Mid(PlainText([FieldName]),InStr(PlainText([FieldName]),”#”)+1)
This is untested, since I am using my phone right now. Once you get a clean address showing in the unbound textbox, you should be able to use your original code against it to copy the web address into the clipboard. Hope it hels...
 
Don't actually change data in table. Just do the calculation in query or textbox or VBA and use the result.

Replace() will work unless you have text before or after the # characters.

These calcs do work with Hyperlink field.
 
Last edited:
isladogs
Gasman
theDBguy
June7
Thank you all for trying to assist us, but since most of us are volunteers with no programming experience, we have entered the Web Address into the (a New Field) Memo Field and programmatically copied the web address to the "Hyperlink" field (from the Memo Field) and every think now works the way we want.

Thank you, ALL
Nicole
 
I am confused. I thought you needed to remove # hyperlink characters from Hyperlink field string?

Then what programming did you use?
 
June7
Yes you are correct in that we needed to remove the symbol "#" from the hyperlink field when we copied the web address into the browser.
After trying MANY different functions,
A = we have found that copying the web address from a text field (memo) works without receiving the symbol "#"
B = when we can use the Hyperlink field to go to most web sites this works

I hope that this answers your question and I/We do appreciate your assistance.

Nicole
 

Users who are viewing this thread

Back
Top Bottom