Required Field Based on Another Field

G

Guest

I have a field "Complexity Code" that must be required. However, I can't
make this field required because the person keying data may not know the
value at the time they key information in.

However, there is another field "Assigned Date" if this field is filled in,
there must be a value entered in the "Complexity Code" field. Therefore I
would like this field to be required based on if there is an entry in the
"Assigned Date" field.

Can this be done?

Thanks!
JS
 
G

Guest

You can use the Form BeforeUpdate event to check this validation, prompt a
message and stop the process if the values are not field properly

Something like:

If Not IsNull(Me.[Assigned Date]) And IsNull(Me.[Complexity Code]) Then
MsgBox "Complexity Code must be filled"
Me.[Complexity Code].SetFocus
Cancel = True ' will stop the save of record
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