Results 1 to 3 of 3

Thread: MSG Box

  1. #1
    Guest

    Cool

    Can someone tell me what I need to do, to do the following.

    Have an msgbox with the option of "yes" or "no" than test for which button they pressed.

    Thank You
    Ken Devorak

  2. #2
    Fanatic Member
    Join Date
    Mar 2000
    Location
    That posh bit of England known as Buckinghamshire
    Posts
    658
    There are a lot of options, look up MSDN.

    Code:
        Dim iResult As Integer
        
        iResult = MsgBox("Hello", vbYesNo)
        If iResult = vbYes Then
          'something
        Else
          'something else
        End If
    Iain, thats with an i by the way!

  3. #3
    Hyperactive Member onerrorgoto's Avatar
    Join Date
    Aug 1999
    Location
    Sweden
    Posts
    330

    Smile Try this

    put a button on a form and use this code
    Code:
    Private Sub Command1_Click()
    If MsgBox("test", vbYesNo) = vbYes Then
        MsgBox "user pressed Yes"
    Else
        MsgBox "user pressed No"
    End If
    End Sub
    good luck

    Well done Iain17, you beat me with a click

    [Edited by onerrorgoto on 05-16-2000 at 10:14 AM]
    Onerrorgoto

    Dont be to optimistic, the light at the end of the tunnel might be a train

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