Need Code Help for If Statement, Please

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
 
S

Scott McDaniel

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top