Consulting

Results 1 to 3 of 3

Thread: Solved: How to insert "Are you sure? -> Yes/No" in code

  1. #1

    Solved: How to insert "Are you sure? -> Yes/No" in code

    How can I insert a simple: "Are you sure? -> Yes/No" sub within an existing macro, so that if a user clicks on the control linked to the macro, it pops up a dialog box with buttons for Yes and No, with Yes executing the Macro and No aborting it?
    Thanks

  2. #2
    Good Evening.

    Try this.

    [VBA]
    Private Sub cmdDelete_Click()
    Dim intResponse as Integer

    intResponse = MsgBox("Are you sure?", vbYesNo, "Delete?")

    Select Case intResponse
    Case vbYes
    ' Process commands.
    Case vbNo
    Exit Sub
    End Select
    End Sub
    [/VBA]

    Scott
    You don't understand anything until you learn it more than one way. ~Marvin Minsky

    I never teach my pupils; I only attempt to provide the conditions in which they can learn. - Albert Einstein

  3. #3
    thank you!

Posting Permissions

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