Multiple Message Boxes

crashnburn99

Registered User.
Local time
Today, 05:53
Joined
Jan 16, 2013
Messages
48
Good afternoon! I am trying to create a script that will delete a file. I have everything in place but I am coming up short with the message boxes. I would like a message box when the user clicks on the button, it would read "Would you like to delete this file" then if they hit ok another message box pops up "you cannot undo these changes, are you sure you want to continue" if they hit ok again the task is performed. The only thing I am getting stuck on is having the second message box open if the first answer is ok. I have tried Case statements and goto's but nothing I have done seems to work. In my frustration I have deleted the code so now I am stuck with nothing. Does anyone have an idea of how to do this?

Thank you in advance for any information you are able to provide.
 
Your code might look something like;
Code:
Dim LResponse As Integer
Dim LResponse2 As Integer

LResponse = MsgBox("Would you like to delete this file", vbYesNo, "Continue")

If LResponse = vbYes Then
   LResponse2 = MsgBox("Are you sure? Deletion can not be undone!", vbYesNo, "Confirm") 
      If LResponse2 =vbYes Then
         [COLOR="DarkGreen"]'Insert Deletion code here[/COLOR]
      Else
         Exit Sub
      End If
Else
   Exit Sub
End If
 
That worked perfect! Thank you so very much!
 

Users who are viewing this thread

Back
Top Bottom