Open web site from a form

G

Guest

I have a form which displays different customer information records (address
book). One of the text boxes in my form is called "web". i have a button on
my form that when the user clicks i want it to open the web site associated
with that record. ive tried the following code on the click() event

openweb = Shell("c:\program files\internet explorer\iexplore.exe", 1)

and this open internet explorer at my default page. Ive tried

openweb = Shell("c:\program files\internet explorer\iexplore.exe [web]", 1)

hoping it would look at the web site in the "web" field but internet
explorer trys to open a web site called [web]

does anyone know what im doing wrong????
 
D

Douglas J. Steele

If web is the name of a control on your form that contains a URL, try

openweb = Shell("c:\program files\internet explorer\iexplore.exe " &
Me.Web, 1)

If you're willing to live with it opening in the default browser, as opposed
to IE, you can use

Application.FollowHyperlink Me.Web
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top