   VB Function Question
  This is just a question I have for a game I'm making. Basically, I just wondered how you tell the program what to do if user clicks Cancel, Abort, Retry or Okay is response to a sudden MsgBox.Thanks in advance.   
Dim intResponse As IntegerintResponse = MsgBox("Whatever you want to ask", "Title", vbYesNoCancel)If (intResponse = vbYes) Then    ' Do whatever you want here for "Yes".ElseIf (intResponse = vbNo) Then    ' Do whatever you want here for "No".ElseIf (intResponse = vbCancel) Then    ' Do whatever you want here for "Cancel".End IfYou can also use other constants to test the return value like vbAbort, vbRetry, etc...  actually, if you declare "intResponse" as type vbResponse (or something like that), it will allow you to use the CodeAssist or whatever it's called, so you can see all the possible values.There are also other options besides vbYesNoCancel (e.g. vbYesNo, vbOkOnly, vbOkCancel, etc) that you can provide to the function to determine which buttons to display.   ;  Thanks a lot Mattman!Oh, and one other thing I was having problems with was pressing command to take me to another form.Hypothetically say I wanted vbOK to take them to the next screen (form3 lets say) or VBCancel to go back to the original form where they can say ... fill out an application form for something again (form 1 lets say).How would I do that?I've tried experimenting with GOTO form3 and GOTO (form3) and everything else I've come accross in program that I thought could work, but it hasn't worked with VB. The book I'm learning from is quite bad and I expect the answer to this question would probably be somewhere in chapter 19 when I'm in Chapter 8 now, and left in the dark.Again, help is appreaciated.   ;  Try this...If intResponse=vbOk Tthen   form3.show ElseIf intResponse=vbCancel Then   form1.showEnd IfThe GoTo statement simply goes to a different line, not a form. Like in this while loop...While TrueMsgBox "This is normally an infinite loop"GoTo theLineWendtheLine: MsgBox "Nice line!"If you executed that, the goto statement would exit the loop and go directly to the aptly named line "theLine", which displays a message box. It can also be used for a block of code like:While TrueMsgBox "This is normally an infinite loop"GoTo theBlockOfCodeWendtheBlockOfCode:MsgBox "Inside the block..."MsgBox "Still inside the block..."If you executed that you would see those two messsage boxes. Also keep in mind that those are just examples, it is not a very good idea to use alot of goto statements in loops, it makes people go insane...Hope that helps :);  Thanks guys.I've tried to do what I just learned, but there's a hitch somewhere. Here is what I put down.Clarify = MsgBox(strman_fname & " " & strman_lname & "are you sure you want proceed managing with " & List1 & "?", =vbYesNo + vbQuestion, "Confirm Decision")If (Clarify = vbYes) Thenform2.ShowElseIf (Clarify = vbNo) Thenmanprofile.ShowEnd IfBasically strman_fname and strman_lname are just the manager's firstname and last name that get entered on the form. List1 is the club they select to manage. manprofile is the name of the form and form2 is a form a created simply for the testing to see if this works - it has no use ... yet.The according to the debugging my problem is somewhere in the =vbYesNO + vbQuestion section of the MsgBox() function. I have no idea what exactly it is though.Any of you know?Help appreaciated.   ;Quote:Original post by ClottyClarify = MsgBox(strman_fname & " " & strman_lname & "are you sure you want proceed managing with " & List1 & "?", =vbYesNo + vbQuestion, "Confirm Decision")Take out the '=' before vbYesNo so it reads:Clarify = MsgBox(strman_fname & " " & strman_lname & "are you sure you want proceed managing with " & List1 & "?", vbYesNo & vbQuestion, "Confirm Decision")Deg   ;Quote:If intResponse=vbOk Tthen   form3.show ElseIf intResponse=vbCancel Then   form1.showEnd IfYou can also write "form3.show 1". "1" is a parameter.Writing in this way can keep form3 activated until a code ends it. ;  So, I have a new problem for you then :)Private Sub cmdproceed_Click()Clarify = MsgBox(strman_fname & " " & strman_lname & "are you sure you want proceed managing with " & List1 & "?", vbYesNo + vbQuestion, "Confirm Decision")If (Clarify = vbYes) ThenForm1.Show AND manprofile.HideElseIf (Clarify = vbNo) Thenmanprofile.ShowEnd IfEnd SubThere is an error here and I know it's in this line "Form1.Show AND manprofile.Hide"I'm guessing it's because I've used the AND in an illegal context for VB6. How else can I do the same thing?Thanks in advance. :)   ;  Why do you need the AND? Just put it on the next line.   ;  That works, I just didn't think of trying it. I supppose as I use VB6 more things like this will just get natural for me.   