G
Guest
I have this code in the Before Update event on a form and only 1/2 of it is
working. This is what I want to do: 1) If the status =1, then clear the
value of the reviewer field (if any). 2)If the status = 1, then clear the
value of the Date of Review field (if any), and 3) If the status <> 1, then
make sure the reviewer field has a name in it or show a msg box.
Can anyone see if there is a problem with my code? I've tried it a few
different ways and it seems like only part of it will execute.
Private Sub Form_BeforeUpdate(Cancel As Integer)
If Me.Status = 1 And IsNull(Me.Reviewer) = False Then
Me.Reviewer.Value = ""
ElseIf Me.Status = 1 And IsNull(Me.Date_of_Review) = False Then
Me.Date_of_Review.Value = ""
ElseIf Me.Status <> 1 And IsNull(Me.Reviewer) = True Then
MsgBox "Please enter your name in the Reviewer field", vbCritical
Cancel = True
End If
End Sub
THANKS!
working. This is what I want to do: 1) If the status =1, then clear the
value of the reviewer field (if any). 2)If the status = 1, then clear the
value of the Date of Review field (if any), and 3) If the status <> 1, then
make sure the reviewer field has a name in it or show a msg box.
Can anyone see if there is a problem with my code? I've tried it a few
different ways and it seems like only part of it will execute.
Private Sub Form_BeforeUpdate(Cancel As Integer)
If Me.Status = 1 And IsNull(Me.Reviewer) = False Then
Me.Reviewer.Value = ""
ElseIf Me.Status = 1 And IsNull(Me.Date_of_Review) = False Then
Me.Date_of_Review.Value = ""
ElseIf Me.Status <> 1 And IsNull(Me.Reviewer) = True Then
MsgBox "Please enter your name in the Reviewer field", vbCritical
Cancel = True
End If
End Sub
THANKS!