# Before & After Web Address # (1 Viewer)

isladogs

MVP / VIP
Local time
Today, 17:25
Joined
Jan 14, 2017
Messages
18,252
I haven't looked at your database
Just use an update query
In the field name concerned , use update to : Replace([FieldName],"#","")
 

Gasman

Enthusiastic Amateur
Local time
Today, 17:25
Joined
Sep 21, 2011
Messages
14,372
As Colin states, use the Replace command in the event for the button where you have the rest of your code.
 

access2010

Registered User.
Local time
Today, 09:25
Joined
Dec 26, 2009
Messages
1,024
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
 

isladogs

MVP / VIP
Local time
Today, 17:25
Joined
Jan 14, 2017
Messages
18,252
Have you or anyone else in your group actually tried what I suggested in post #2? It will work
 

theDBguy

I’m here to help
Staff member
Local time
Today, 09:25
Joined
Oct 29, 2018
Messages
21,503
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.
 

access2010

Registered User.
Local time
Today, 09:25
Joined
Dec 26, 2009
Messages
1,024
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
 

access2010

Registered User.
Local time
Today, 09:25
Joined
Dec 26, 2009
Messages
1,024
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
 

theDBguy

I’m here to help
Staff member
Local time
Today, 09:25
Joined
Oct 29, 2018
Messages
21,503
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...
 

June7

AWF VIP
Local time
Today, 08:25
Joined
Mar 9, 2014
Messages
5,489
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:

access2010

Registered User.
Local time
Today, 09:25
Joined
Dec 26, 2009
Messages
1,024
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
 

June7

AWF VIP
Local time
Today, 08:25
Joined
Mar 9, 2014
Messages
5,489
I am confused. I thought you needed to remove # hyperlink characters from Hyperlink field string?

Then what programming did you use?
 

access2010

Registered User.
Local time
Today, 09:25
Joined
Dec 26, 2009
Messages
1,024
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

Top Bottom