required data in combo box

G

Guest

Hello,

I have a form with 20 combo boxes on it for data entry. There are times
when my people need to move to a new record without completing the first
record, so I don't have "REQUIRED" set for all combos. However, I'd like to
somehow tell Access (I'm assuming via code) that:

Combo Box "station" must be filled in if Combo Box "dept" has "upholstery"
as the selection. Can someone help?

Thank you much,
Aaron
 
B

Brian

Aaron said:
Hello,

I have a form with 20 combo boxes on it for data entry. There are times
when my people need to move to a new record without completing the first
record, so I don't have "REQUIRED" set for all combos. However, I'd like to
somehow tell Access (I'm assuming via code) that:

Combo Box "station" must be filled in if Combo Box "dept" has "upholstery"
as the selection. Can someone help?

Thank you much,
Aaron

In the form's BeforeUpdate event, you'll be needing something like this::

If [dept] = "upholstery" Then
If IsNull([station]) Then
MsgBox "You must enter a value for Station"
Cancel = True
End If
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