Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!
  1.   Become a Supporter    ::   Make a Contribution   
    Target (Recurring Monthly): $200 :: Achieved: $98

Close App. with a MessageBox

Discussion in 'Information Technology' started by AFSSkier, Jul 28, 2006.

  1. AFSSkier

    AFSSkier
    Expand Collapse
    Guest

    How can I do a close app. using DoCmd.Quit with a MSGBOX saying "Are you sure
    you want to close Application?".
    --
    Thanks, Kevin
     
  2. Loading...

    Similar Threads Forum Date
    SciTech Jupiter Making Closest Approach To Earth In Nearly 50 Years Breaking News Sep 20, 2010
    India Who says we have skeletons only in our closets? Breaking News Aug 22, 2014
    India After Badrinath, Kedarnath now Sikh shrine Hemkunt Sahib closed temporarily Breaking News Jun 28, 2013
    Grammer / Vyakarn Fateh multimedia forced to close for lack of funds Language, Arts & Culture Nov 21, 2012
    General The Closer Videos Jul 26, 2012

  3. fredg

    fredg
    Expand Collapse
    Guest

    On Tue, 11 Jul 2006 17:42:01 -0700, AFSSkier wrote:

    > How can I do a close app. using DoCmd.Quit with a MSGBOX saying "Are you sure
    > you want to close Application?".


    If MsgBox("Are you sure you want to close the Application",vbYesNo) =
    vbYes then
    DoCmd.Quit
    End If

    --
    Fred
    Please respond only to this newsgroup.
    I do not reply to personal e-mail
     
  4. Douglas J Steele

    Douglas J Steele
    Expand Collapse
    Guest

    "fredg" <fgutkind@example.invalid> wrote in message
    news:1p7qmj9ud1ypm.49a1kpq4tm1o.dlg@40tude.net...
    > On Tue, 11 Jul 2006 17:42:01 -0700, AFSSkier wrote:
    >
    > > How can I do a close app. using DoCmd.Quit with a MSGBOX saying "Are you

    sure
    > > you want to close Application?".

    >
    > If MsgBox("Are you sure you want to close the Application",vbYesNo) =
    > vbYes then
    > DoCmd.Quit
    > End If


    In the event that you're trying to stop accidental shutdown of the
    application, have a form that's always open (it needn't be visible). In that
    form's Unload event, put:

    If MsgBox("Are you sure you want to close the Application?",vbYesNo) <>
    vbYes then
    Cancel = True
    End If


    --
    Doug Steele, Microsoft Access MVP
    http://I.Am/DougSteele
    (no e-mails, please!)
     
  5. AFSSkier

    AFSSkier
    Expand Collapse
    Guest

    This is the current Form Code Argument.

    ' Exit the application.
    Case conCmdExitApplication
    DoCmd.Quit

    Is this how the new Argurment with the MsgBox should be?

    ' Exit the application.
    Case conCmdExitApplication
    If MsgBox("Are you sure you want to close the Application",vbYesNo) =
    vbYes then
    DoCmd.Quit

    --
    Thanks, Kevin


    "fredg" wrote:

    > On Tue, 11 Jul 2006 17:42:01 -0700, AFSSkier wrote:
    >
    > > How can I do a close app. using DoCmd.Quit with a MSGBOX saying "Are you sure
    > > you want to close Application?".

    >
    > If MsgBox("Are you sure you want to close the Application",vbYesNo) =
    > vbYes then
    > DoCmd.Quit
    > End If
    >
    > --
    > Fred
    > Please respond only to this newsgroup.
    > I do not reply to personal e-mail
    >
     
  6. Douglas J Steele

    Douglas J Steele
    Expand Collapse
    Guest

    Don't forget the End If after the DoCmd.Quit

    --
    Doug Steele, Microsoft Access MVP
    http://I.Am/DougSteele
    (no e-mails, please!)


    "AFSSkier" <AFSSkier@discussions.microsoft.com> wrote in message
    news:B72454B6-8270-4964-B007-AD8DE7D8024B@microsoft.com...
    > This is the current Form Code Argument.
    >
    > ' Exit the application.
    > Case conCmdExitApplication
    > DoCmd.Quit
    >
    > Is this how the new Argurment with the MsgBox should be?
    >
    > ' Exit the application.
    > Case conCmdExitApplication
    > If MsgBox("Are you sure you want to close the Application",vbYesNo) =
    > vbYes then
    > DoCmd.Quit
    >
    > --
    > Thanks, Kevin
    >
    >
    > "fredg" wrote:
    >
    > > On Tue, 11 Jul 2006 17:42:01 -0700, AFSSkier wrote:
    > >
    > > > How can I do a close app. using DoCmd.Quit with a MSGBOX saying "Are

    you sure
    > > > you want to close Application?".

    > >
    > > If MsgBox("Are you sure you want to close the Application",vbYesNo) =
    > > vbYes then
    > > DoCmd.Quit
    > > End If
    > >
    > > --
    > > Fred
    > > Please respond only to this newsgroup.
    > > I do not reply to personal e-mail
    > >
     
  7. fredg

    fredg
    Expand Collapse
    Guest

    On Wed, 12 Jul 2006 07:48:03 -0700, AFSSkier wrote:

    > This is the current Form Code Argument.
    >
    > ' Exit the application.
    > Case conCmdExitApplication
    > DoCmd.Quit
    >
    > Is this how the new Argurment with the MsgBox should be?
    >
    > ' Exit the application.
    > Case conCmdExitApplication
    > If MsgBox("Are you sure you want to close the Application",vbYesNo) =
    > vbYes then
    > DoCmd.Quit


    Don't forget to add the End if after DoCmd.Quit.

    Case conCmdExitApplication
    If MsgBox("Are you sure you want to close the Application",vbYesNo) =
    vbYes then
    DoCmd.Quit
    END IF
    --
    Fred
    Please respond only to this newsgroup.
    I do not reply to personal e-mail
     
  8. AFSSkier

    AFSSkier
    Expand Collapse
    Guest

    Thanks Fred & Douglas!
    --
    Thanks, Kevin


    "Douglas J Steele" wrote:

    > Don't forget the End If after the DoCmd.Quit
    >
    > --
    > Doug Steele, Microsoft Access MVP
    > http://I.Am/DougSteele
    > (no e-mails, please!)
    >
    >
    > "AFSSkier" <AFSSkier@discussions.microsoft.com> wrote in message
    > news:B72454B6-8270-4964-B007-AD8DE7D8024B@microsoft.com...
    > > This is the current Form Code Argument.
    > >
    > > ' Exit the application.
    > > Case conCmdExitApplication
    > > DoCmd.Quit
    > >
    > > Is this how the new Argurment with the MsgBox should be?
    > >
    > > ' Exit the application.
    > > Case conCmdExitApplication
    > > If MsgBox("Are you sure you want to close the Application",vbYesNo) =
    > > vbYes then
    > > DoCmd.Quit
    > >
    > > --
    > > Thanks, Kevin
    > >
    > >
    > > "fredg" wrote:
    > >
    > > > On Tue, 11 Jul 2006 17:42:01 -0700, AFSSkier wrote:
    > > >
    > > > > How can I do a close app. using DoCmd.Quit with a MSGBOX saying "Are

    > you sure
    > > > > you want to close Application?".
    > > >
    > > > If MsgBox("Are you sure you want to close the Application",vbYesNo) =
    > > > vbYes then
    > > > DoCmd.Quit
    > > > End If
    > > >
    > > > --
    > > > Fred
    > > > Please respond only to this newsgroup.
    > > > I do not reply to personal e-mail
    > > >

    >
    >
    >
     
Since you're here... we have a small favor to ask...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     



Share This Page