Hyperlink HTTP Checker

SteveC24

Registered User.
Local time
Today, 13:59
Joined
Feb 1, 2003
Messages
444
Hi,

Further to my post yesterday about having a button that would open a website address from a text box.

I have got that going now with this code:

Code:
On Error GoTo Error
Application.FollowHyperlink "http://" & URL
Error:
If Err = 94 Then
Exit Sub
Else
Exit Sub
End If


I now want the textbox to automatically take the HTTP:// out of any address the user may enter.
So, for example, if the user entered: http://www.access-programmers.co.uk, then the database takes out the http://.

Whereas, if the user entered www.access-programmers.co.uk, then the database would leave it alone.

Thanks anyone!
 
To search for a string within a string, I think you use Instr() function. I haven´t done it, so I don´t know the exact syntax. I think it finds the starting position of the searched string (the http://, hopefully returning nothing or producing an error if there is no http://), which you can use in a mid() function to return everything after the http://.(or within an if-statement if it produces an error).

Now like I said I haven´t done it, so if I´m wrong I apologize and hope someone else can help you.

Fuga.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom