Results 1 to 5 of 5

Thread: msgbox question

  1. #1
    tbone231
    Guest

    msgbox question

    this code won't end the program, it just sends me back to my form, i want it to end the program, what am i doing wrong....

    Private Sub cmdcancel_Click()
    Dim intresponse As Integer
    MsgBox "Are you sure you want to quit the program?", vbYesNo, "You Actually Want to Quit?"
    If intresponse = vbYes Then
    End
    End If
    End Sub

  2. #2
    Lively Member pegasus's Avatar
    Join Date
    Nov 1999
    Location
    Birmingham, United Kingdom
    Posts
    88

    msgbox

    heres how u can do it:

    Private Sub cmdcancel_Click()
    q = Msgbox ("Are you sure you want to quit the program?", vbYesNo, "You Actually Want to Quit?")

    if q = vbYes then

    end

    else
    end if
    end sub

    hope that works..
    ..if it doesn't post bac and ill look it up. this is all of the top of my head...

    hope i helped,
    pegasus
    Those who say that size doesn't matter, aren't big enough to admit that they're wrong.

    Sex is like a bank account: once you withdraw, you lose interest.

    ______________________________
    Code:
               |^^^^^|
               \-Ó-Ò-/
               | |_| |
                \\_//
             __ |   |__
           /|   \___/  |\
          / |          | \
         /  | Faisal   \  \
        |  /  Karjikar |  |
        \ _\___________|_/
            \         /
            |    \/   |
            |    ||   |
            |____||___|
            \ _ / \ _ /
            /|_|\ /|_|\
     ______ |___| |___| ____
    /_/\/\/\/\/\/\/\/\/\/\/\/\/\//\
    _\/\/\/\/\/\/\/\/\/\/\/\/\/\//\
    /\/\/\/\/\/\/\//\/\/\/\/\/\//\\/\/
    
    ^
    Its meant to be the ocean... :D

  3. #3
    nullus
    Guest
    teehee, you never assigned the result of the msgbox to the variable

    VB Code:
    1. If (MsgBox("You wanna quit, huh?", vbYesNo) = vbYes) Then
    2.   End
    3. End If

    works nicer i think

  4. #4
    Lively Member Blaster's Avatar
    Join Date
    Jun 2001
    Posts
    70
    Private Sub Command1_Click()
    intresponse = MsgBox("Are you sure you want to quit the program?", vbYesNo, "You Actually Want to Quit?")
    If intresponse = vbYes Then
    End
    End If
    End Sub

  5. #5
    tbone231
    Guest

    duh

    assigning the variable would help

    must have had a brain freeze: rolleyes:

    thanks everybody

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width