View Full Version : require a field based on data in another field


bevans
05-30-2000, 08:25 AM
Hello,
I am trying to create a form that requires one field to have data only when another field is changed/updated.

Any help is greatly appreciated!
Thanks

Pat Hartman
05-30-2000, 05:45 PM
Do your editing in the form's BeforeUpdate event. If fldA is not null but fldB is, use a msgbox to display an error message and cancel the record update by setting cancel to true -

If IsNull(fldA) Then
Else
If IsNull(fldB) Then
MsgBox "Field B must not be null", vbOKOnly
Cancel = True
End If
End If