Message Box

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Stang02GT
    Recognized Expert Top Contributor
    • Jun 2007
    • 1206

    Message Box

    Hello,

    Id like to prompt my users with a message box when they go to delete something...ask ing them if they are sure they want to continue with the delete. I've never done anythign like this so any help would be great!!!


    Thank you in advance!
  • JKing
    Recognized Expert Top Contributor
    • Jun 2007
    • 1206

    #2
    Here's a two short examples of using a message box with yes and no.

    [code=vb]
    Dim intAnswer As Integer
    intAnswer = MsgBox("Are you sure you want to continue?", vbYesNo + vbQuestion, "Warning")

    Select Case intAnswer
    Case vbYes
    'Do delete code here
    Case vbNo
    'Dont do delete code here
    End Select

    'Using MsgBox in an if else statement
    If MsgBox("Are you leaving?", vbYesNo + vbInformation, "Alert") = vbYes Then
    MsgBox "Goodbye!"
    Else
    MsgBox "Glad you're staying!"
    End If

    [/code]

    Parameters are: message, buttons + icon, title

    Comment

    • Stang02GT
      Recognized Expert Top Contributor
      • Jun 2007
      • 1206

      #3
      Awsome! THank you very much!

      Comment

      Working...