Dependent Fields

Deb2014

New member
Local time
Today, 02:37
Joined
Dec 6, 2014
Messages
2
I have a table with 3 yes/no fields. I need them to be dependent on each other meaning if one is yes the others can not be yes. How can I set this up?
 
I need them to be dependent on each other meaning if one is yes the others can not be yes.

An improper structure warning light went off in my brain. Not a full, alarm, but I think you might have your data set up incorrectly.

I believe those 3 fields should probably have their values combined into one field. You didn't provide info on what those 3 fields are, so let me make an example:

You want to store if a person has brown, green or blue eyes. You would not do this:

PeoplesEyes
PersonID, HasBlueEyes, HasGreenEyes, HasBrownEyes
17, True, False, False
42, False, True, False
44, True, False, False

Instead you'r data should look like this:

PersonEyes
PersonID, Color
17, Blue
42, Green
44, Blue

Since your 3 fields are mutually exclusive, I think they need to go into 1 field.
 
And to follow on from Plogs advice, you would then use an option group on your form to select one option over another (or a combo box)

Edit - see Paul has already suggested that:o
 
I'm trying to set up a database to track inventory. The yes/no fields are: on hand, shipped, or wasted.

Only one needs to be chosen but depending on which one is chosen it needs to require other fields. For instance if shipped is yes then the shipped to field needs to be required. If on hand is yes then location needs to be required. If wasted then reason and date fields need to be required. That's why I went with separate fields to begin with since other fields will also be dependent on them as well.

With this in mind is one field with options still the best way to go?
 
It's the way I would go. Instead of testing 3 fields you'd be testing 1 for 3 values.
 

Users who are viewing this thread

Back
Top Bottom