Welcome to SPN

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

Sign Up Now!

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
    > > >

    >
    >
    >
     

Share This Page