Make a field mandatory on 1 form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am using Access 2003
I have a form employees used to check out equipment. Each piece of
equipment is given a number. The employees look up the equipment number and
then check a (true/false) box to indicate they took the equipment. Now I
have added a new field called [ID] in which they put their employee number in
to indicate who took the equipment (like a signature). I want to be able to
tie the [ID] field to the check box, so that if they check the box, they HAVE
TO fill in the [ID] field before they can leave the database screen. I tried
to do this in the query but have not been real successful. Can anyone make
any suggestions. I can not make this mandatory in the table because there
are other form that contain this same field and I do not want it mandatory in
the other forms.

I would appreciate any help you can give me - thanks - aurora
 
Cancel the BeforeUpdate event procedure of the *form* if the field is null:

Private Sub Form_BeforeUpdate(Cancel As Integer)
If IsNull(Me.[ID]) Then
Cancel = True
MsgBox "ID required."
End If
End Sub
 
Back
Top