Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2014
    Posts
    10

    Unanswered: vbYesNo to resume or restart an onclick event

    Good morning to every one
    I have a form that inserts la large amount of data in a table at one go. I wish to alert the user to confirm this action before. I made a massage box with vbYesNo, if vbYes is true then it resumes the rest of the button onclick event (far now it works) but if vbNo is chosen I need to stop the procedure and restarts/return to the from without inserting any data. Can you please guide me with the last part of the code?
    Thanks

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    Code:
    If Mgsbox("Your message here", vbYesNo + vbQuestion, "Please confirm") = vbYes Then
        <Insert here the code to do whatever you want when the user press the Yes button.>
    End If
    Have a nice day!

  3. #3
    Join Date
    Sep 2014
    Posts
    10
    thanks for the help and it did work, actually I was complicating my life since i wrote a public function, then I called it when ever i needed it. I did so because the form I am using has several buttons to handle different types of data entries so I would just call the function. but your advice works just fine thanks once more.

  4. #4
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    You're welcome!
    Have a nice day!

Posting Permissions

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