Field required only if check box selected

  • Thread starter Thread starter Breezy
  • Start date Start date
B

Breezy

I need to make one field required on my form only if the user checks the box
as complete. I would like to have something pop up and ask for the RO# that
they used to complete the work. I have the field on the form but do not know
how to make it required after selecting complete.
 
I need to make one field required on my form only if the user checks the box
as complete. I would like to have something pop up and ask for the RO# that
they used to complete the work. I have the field on the form but do not know
how to make it required after selecting complete.

Since the two controls could be filled out in either order, your best bet is
to put the check in the Form's (not either control's) BeforeUpdate event: e.g.

Private Sub Form_BeforeUpdate(Cancel as Either)
If Me!chkComplete = True AND If Me!txtRONumber & "" = "" Then
Cancel = True
MsgBox "Please fill in the RO#", vbOKOnly
End If
End Sub
 
I understood him to say that he wanted to check if RO# was filled out when
the COMPLETE box.

That's exactly what I understood as well. I called the COMPLETE box
chkComplete - the OP should use whatever the name of the control might be.
 
Back
Top