0

Determine if linked record's Multiple Choice contains value from this record's Choice field

This record has a Choice field with two values: Cat, Dog and this record (obviously) can only be one or the other.

This record has a linked Colouring table where each record has a Colour (text) and a Multiple Choice field with two values: Cat, Dog (but each Colouring could have both Cat and Dog checked).

I'm trying to constrain the combo box for Colouring on this form so that it only shows Colourings that are assigned to the particular type of animal for this record.

I've tried many constraints like this, but none work. As you can see, the Colouring combobox has the same values whether this record's Pet Type is Cat or Dog. In my example below, when Dog is chosen there should only be a couple values and should not contain any "Bicolor" entries (among others).

Incidentally, I have a Breed linked table where the Breeds have a Pet Type Choice (not Multiple Choice) and making that one work was easy: a.'Pet Type' = b.'Pet Type'

 

b.Pets.'Pet Type' = a.Colouring.'Pet Type'

 

Copy

 

Copy

 

b.Pets.'Pet Type' like a.Colouring.'Pet Type'

 

Copy

 

Copy

 

How can I make this constraint work?

 

3 replies

null
    • Kent_Signorini
    • 1 yr ago
    • Reported - view

    (I don't know why this message says "Copy" over and over again.)

    • Fred
    • 1 yr ago
    • Reported - view

    Once you start working with multiple choice fields (regular or dynamic) then you can't use the equal sign so easily.

    Once a record has both options (cat and dog) selected then the field now has two values. So if you select cat and then use an equal sign it will only look for records with only cat since that is the only way both fields are equal.

    Switch your equal to like and see if that works better. Here is what it looks like in my test db.

    The first shows when I select cat it shows records that have Cat only (record 3) and those that contain Cat (1 and 4).

    The second pic shows how it changes when I select Dog. Records 1 and 4 stay since they have Dog as a selection. 3 disappears and 6 appears.

      • Kent_Signorini
      • 1 yr ago
      • Reported - view

      Fred 

      Sigh. Yeah, like instead of = is the key, but it has to be in the right order. So simple to actually make it work...
       

      b.'Pet Type' like a.'Pet Type'

       

      I'll get the hang of this yet.

Content aside

  • 1 yr agoLast active
  • 3Replies
  • 135Views
  • 2 Following