Can someone tell me why the first code snippet won't progress through? When I click No on the message box from the first if statement, the code isn't progressing through to the next if statement.
When I use select case for other validations, it steps through as desired.
Code:
Private Sub cmd_Submit_Click()
Dim cGender, cEntryType, cPymtFreq, cPymtStatus, cStatus, cPymtMethod, cRefCat, cFacilitator, cPymtReason, cBiosClientID, cBiosNickname, cStatsClientID As Range
Dim ws1, ws2, ws3, ws4, ws5, ws6, ws7 As Worksheet
Dim Verify As Integer
Dim Response As VbMsgBoxResult
Dim IsOk As Boolean
IsOk = True
Set ws1 = ThisWorkbook.Sheets("Management")
Set ws2 = ThisWorkbook.Sheets("Summaries")
Set ws3 = ThisWorkbook.Sheets("Bios")
Set ws4 = ThisWorkbook.Sheets("Stats")
Set ws5 = ThisWorkbook.Sheets("Pymt Tracker")
Set ws6 = ThisWorkbook.Sheets("Financials")
Set ws7 = ThisWorkbook.Sheets("Variables")
LastRow2 = ws2.Range("C" & Rows.Count).End(xlUp).Row
LastRow3 = ws3.Range("E" & Rows.Count).End(xlUp).Row
LastRow4 = ws4.Range("C" & Rows.Count).End(xlUp).Row
LastRow5 = ws5.Range("C" & Rows.Count).End(xlUp).Row
LastRow6 = ws6.Range("D" & Rows.Count).End(xlUp).Row
LastRow7 = ws7.Range("J" & Rows.Count).End(xlUp).Row
If Len(Me.txt_DPDate.Value) = 0 And Len(Me.txt_DPAmt.Value) = 0 And Len(Me.txt_DPPaid.Value) = 0 Then
Verify = MsgBox("Did the Client sign up for a DP?", vbYesNo)
If Response = vbYes Then Me.txt_DPDate.SetFocus
Exit Sub
End If
If (Not Len(Me.txt_CTIStart.Value) = 0 Or Not Len(Me.txt_CTI1stPymt.Value) = 0 Or (Me.txt_CTIPymtAmt.Value) > 0 Or Not Len(Me.cobo_CTIFreq.Value) = 0 Or _
(Me.txt_CTIAmtPaid.Value) > 0) And (Len(Me.txt_CTIStart.Value) = 0 Or Len(Me.txt_CTI1stPymt.Value) = 0 Or Len(Me.txt_CTIPymtAmt.Value) = 0 Or Len(Me.cobo_CTIFreq.Value) = 0) Then
MsgBox "Please complete the partial information in the CT-I section."
If Response = vbOK Then Me.txt_CTIStart.SetFocus
Exit Sub
End If
When I use select case for other validations, it steps through as desired.
Code:
Select Case True
Case Me.txt_Notes = ""
MsgBox "Please enter pertinent notes about the Client."
If Response = vbOK Then Me.txt_Notes.SetFocus
Exit Sub
IsOk = False
Case Me.cobo_TotalPymtMethod = ""
MsgBox "Please select the method the Client used to tender funds."
If Response = vbOK Then Me.cobo_TotalPymtMethod.SetFocus
Exit Sub
IsOk = False
End Select