Need Code Help for If Statement, Please

  • Thread starter Thread starter Dave Elliott
  • Start date Start date
D

Dave Elliott

This code is giving me a error. Block If without End If and then it
highlights the End Sub
What am I doing wrong ?

Thanks,

Dave

Private Sub Form_BeforeUpdate(Cancel As Integer)
If IsNull(Combo38) Then
MsgBox "Need Type of Call"
Cancel = True
If IsNull(Combo6) Then
MsgBox "Employee Needed"
Cancel = True
End If
End Sub
 
Your have 2 "If" statements, but only 1 "End If". Change it as such:


If IsNull(Combo38) Then
MsgBox "Need Type of Call"
Cancel = True
End If

If IsNull(Combo6) Then
MsgBox "Employee Needed"
Cancel = True
End If

=== OR =====

If IsNull(Combo38) Then
MsgBox "Need Type of Call"
Cancel = True
ElseIf IsNull(Combo6) Then
MsgBox "Employee Needed"
Cancel = True
End If
 
Back
Top