Opening a Webpage from a Form (1 Viewer)

Mordhel

New member
Local time
Today, 18:22
Joined
Nov 14, 2002
Messages
8
I am trying to set a button on a Form which will open the website which is contained in a Textbox on the same form.

I used to simply have the underlying table field set to hyperlink, but this caused problems in other reports where it showed the contents twice (ie www.homepage.com#www.homepage.com#). Which caused even more problems down the line.

I have a button on Form1 which can send an email, and one which can mailmerge. But I cannot find a way to get it to open the webpage without having the table field which the textbox is linked to set as a hyperlink. :confused:

Alternatively if there is a way to show the contents of a hyperlink field in a report without the extra bit (ie www.homepage.com instead of www.homepage.com#www.homepage.com)

Any suggestions would be helpful.
 

lloydmav

Registered User.
Local time
Today, 18:22
Joined
Nov 15, 2002
Messages
75
To open a website all you need is the single line of code beneath

x = Shell("explorer.exe http://www.website.co.uk", vbMaximizedFocus)

To get the web address from a textbox, try something along the lines of

Dim website
website = Text1
and then try to replace the web address in the code above with 'website'

Opening a website works but I haven't tried that from a textbox yet!

Hope that helps
 

mikeder

Member
Local time
Today, 18:22
Joined
Nov 12, 2002
Messages
34
doesn't work though

Hi,

The code below to open a link from a text box doesn't work

Dim website
website = Text1
x = Shell("explorer.exe website", vbMaximizedFocus)


Can you tell me how to do this? I'm actually trying to open a link from a combo box. The combo box contains a list of approx 500 file locations. I want to be able to click on a button and have it take me to that location on my server. I'm not a coder so I'm not sure how to do it.

Thanks.
 

lloydmav

Registered User.
Local time
Today, 18:22
Joined
Nov 15, 2002
Messages
75
Your right it didn't work, try this instead!

Dim Website
Website = ComboBox1
Application.FollowHyperlink Website
 

mikeder

Member
Local time
Today, 18:22
Joined
Nov 12, 2002
Messages
34
didn't work

Hi,

Thanks for the suggestion but that doesn't work either.

It doesn't produce an error message but it doesn't work either. I've been spending hours on MSN and ICQ with others trying to figure this out and it's puzzled us.

Got any other suggestions?
 

lloydmav

Registered User.
Local time
Today, 18:22
Joined
Nov 15, 2002
Messages
75
It works for me!

You need to make sure you enter the full address eg;
http://www.website.com

I know it sounds daft but also make sure you have the correct name eg combo3,
 

Users who are viewing this thread

Top Bottom