I have a spreadsheet that has multiple user forms attached to it. I'm trying to ask a series of questions to get the user to the right form. Below are the 2 scripts I've been trying to get to work. I don't care which one ends up working, I just need one of them to work right HELP????
code problems:
vbYesNoDemo works perfect until it gets to the question "do they need to file a claim" then no matter what I choose it just keeps going in order instead of going to the answer chosen
vbrecReturned_Cards_Click is the same except if you only answer yes to the follow up questions you get to the right place, you run into a problem if you try and choose no
code problems:
vbYesNoDemo works perfect until it gets to the question "do they need to file a claim" then no matter what I choose it just keeps going in order instead of going to the answer chosen
vbrecReturned_Cards_Click is the same except if you only answer yes to the follow up questions you get to the right place, you run into a problem if you try and choose no
VBA Code:
Sub vbYesNoDemo()
Dim userResponse As Integer
userResponse = MsgBox("Is the name on the card different than the name of the person handing you the card?", vbYesNo)
If userResponse = vbYes Then
Call frmReturned_Cards.Show
Exit Sub
Else: userResponse = vbNo
Answer = MsgBox("Do they need to file a claim?", vbYesNo + vbQuestion) 'issue starts here
If vbYes Then
Answer = MsgBox("Have any weeks paid out under the fictitious claim?", vbYesNo + vbQuestion)
If vbYes Then
Call frmNeed_To_File_Wks_Pd.Show
ElseIf vbNo Then Call recNot_Paid_Need_Click
ElseIf vbNo Then
Answer = MsgBox("Have any weeks paid out under the fictitious claim?", vbYesNo + vbQuestion)
If vbYes Then
Call frmNo_Need_Wks_Pd.Show
Else: Call frmNo_Need_No_Wks_Pd.Show
End If
End If
End If
End If
End Sub
VBA Code:
Sub recReturned_Cards_Click()
Dim Answer As Integer
Answer = MsgBox("Is the name on the card different than the name of the person handing you the card?", vbQuestion + vbYesNo, "Who's card is it?")
Select Case Answer
Case vbYes
frmReturned_Cards.Show
Case vbNo
Answer = MsgBox("Do they need to file a claim?", vbQuestion + vbYesNo, "Need to file")
Select Case Answer
Case vbYes
Answer = MsgBox("Have any weeks paid out under the fictitious claim?", vbQuestion + vbYesNo, "Weeks Paid")
Select Case Answer
Case vbYes
frmNeed_To_File_Wks_Pd.Show
Case vbNo
frmNot_Paid_Need_Click.Show
Case vbNo
Answer = MsgBox("Have any weeks paid out under the fictitious claim?", vbQuestion + vbYesNo, "Weeks Paid")
Select Case Answer
Case vbYes
frmNo_Need_To_File_Wks_Pd.Show
Case vbNo
recNot_Paid_Not_Need_Click
End Select
End Select
End Select
End Select
End Sub