Re: Another Button (link to website)
- From: Klatuu <Klatuu@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 4 May 2005 10:26:05 -0700
Put this line of code in the On Click Event of the command button you want to
use to get to Paypal.
The Shell function starts an application, in this case Internet Explorer.
It should contain the full path to the application.
C:\Program Files\Internet Explorer\iexplore
The next bit is a command line argument that tells the application
information it can use when it starts. In this case, it is the URL to go to.
http://www.paypal.com
Then, we tell it the Window Style to use. In this case, 3 = Maximized with
Focus.
VBA Help will give you more info if you need it.
One thing to keep in mind. The shell function does not wait for the
application it is calling to complete. The code continues processing.
Usually, this is not a problem, but if it is, let me know and we can deal
with it. I don't want to overload you with info now.
It would look something like this:
Private Sub cmdPayPal_Click()
On Error GoTo cmdPayPal_Err
shell("C:\Program Files\Internet Explorer\iexplore http://www.paypal.com",3)
cmdPayPal_Exit:
Exit Sub
cmdPayPal_Err:
MsgBox Error$
Resume cmdPayPal_Exit
End Sub
"Neil Greenough" wrote:
> Could you please elaborate a bit more on this? I am new to VBA and as such,
> if possible, could you please tell me the whole code?
>
> Thanks
>
> "Klatuu" <Klatuu@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:198FCE41-E886-4B01-8E46-9617A76B61DF@xxxxxxxxxxxxxxxx
> > shell("C:\Program Files\Internet Explorer\iexplore
> > http://www.paypal.com",3)
> >
> > "Neil Greenough" wrote:
> >
> >> I have a button on a form and would like to add some VBA to the button.
> >>
> >> When the user clicks on the button, I would like their internet package
> >> (either Internet Explorer or Netscape) to open and for them to be taken
> >> straight to http://www.paypal.com
> >>
> >> Also, when they click on the button, I would like a confirmation box to
> >> appear, saying "Are you sure you want to access the internet?"
> >>
> >> Thanks
> >>
> >>
> >>
>
>
>
.
- References:
- Another Button (link to website)
- From: Neil Greenough
- RE: Another Button (link to website)
- From: Klatuu
- Re: Another Button (link to website)
- From: Neil Greenough
- Another Button (link to website)
- Prev by Date: open hyperlink as read only
- Next by Date: RE: Disable access to the database window
- Previous by thread: Re: Another Button (link to website)
- Next by thread: Exporting from access to excel problem using vba.
- Index(es):