http:// doubling up (http://http://)

ehorde

Registered User.
Local time
Yesterday, 22:12
Joined
May 21, 2009
Messages
21
I have a form with a button that does this:

Private Sub Command64_Click()
Dim IE
Set IE = CreateObject("internetexplorer.application")
IE.Navigate Map.Value
IE.Visible = True
End Sub

The field on the form is called [Map] and it contains something like http://www.thelink.com

The button works, except it opens up ie with this address:

http://http://www.thelink.com

If at a loss, I think I need to somehow strip the http:// out of the text box called [Map] when the after the is entered. It is simple enough to just put a warning on the [Map] text box to tell the user to removed the http:// , but I know they will forget and call me when the link doesn't work because of the double http://'s

Thanks in advance.. I searched and can't find anything on this
 
Last edited:
well cant ou strip the prefix from the [map] field

so you get

IE.Navigate massage(Map.Value)
 
Would this work?

IE.Navigate Replace(Map.Value, "http://","")
 
Would this work?

IE.Navigate Replace(Map.Value, "http://","")

Because the first part can be pasted as a bookmark or as an https://,

https://
#https//

I need to be able to tell is to only use text after the last set of double slashes //.

I can't help but think there is an easier way to do this. I have seen code in action that strips the http:// as soon as you exit the field (afterupdate event?) but I have not seen what's under the hood.

Kind of like

"if me like http:// then"

or

"if me like #http:// then"
 
Code:
Would this work?

IE.Navigate Replace(Map.Value, "http://","")

That works great!
Thanks, I'll tweak the if/thens for different scenarios later.

Thanks again.
 
I thought I had this worked out but a new day brings new problems.

Access is automatically wrapping # around the text box that contains the hyperlink.

So when I type in the text box: http://maps.yahoo.com

Access changes it to: #http://maps.yahoo.com#

Another thing is that I have told access that the text box is not a hyperlink (Is Hyperlink = No), but access still changes it to a live hyperlink. I don't want it to be a live hyperlink, I just want it to be a textbox that contains a hyperlink as plain text.

How do I get access to keep the text in the text box as plain text and not a hyperlink?
 
Last edited:
Instead of storing it with the http:// part, just store with the www.yyyyy.com part.
 
Instead of storing it with the http:// part, just store with the www.yyyyy.com part.

I tried that, it wraps the string with # at each end.

www.yyyyy.com becomes #www.yyyyy.com#

You can's see it because access hides the # symbols, however, when you edit the field they display. Clear the #'s out, exit the field and they pop right back in there as hidden. !%@!*%

Then when you stert the browser you get http:///#www.yyyy.com#

I have no idea where the extra "/" is coming from because that is nowhere to be found!
 
There has got to be some way to enter a string containing http://www.yyyyy.com
and have NOT a hyperlink. Me thinks access can be smart for own good sometimes.
 
It won't add those characters if the datatype in the table is set to TEXT. It must be currently set to HYPERLINK instead, which is what does this behavior.
 
It is set to "Plain Text", Display as hyperlink does not have "No" or "Never" option. fyi - this is accesss 2007
 
Last edited:
It is set to "Plain Text", Display as hyperlink does not have "No" or "Never" option. fyi - this is accesss 2007

Plain Text is not a datatype in the table so I'm guessing that you and I are not connecting as to what I'm talking about. I'm talking about opening the table in design view, going to that field and the datatype should say TEXT. The Field Size should say 255.
 
I feel like an idiot. I have been twaeking the form when I should have been in the table. Ahh, live and lern. Thanks SOS
 

Users who are viewing this thread

Back
Top Bottom