Jump to content

Compare Checkbox fields?


zeugma
 Share

This topic is 6496 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies

Howdy!

Q: I want to flag the user when checkbox options in Field B match the options selected in Field A. I don't know how!

Details:

I have a value list of checkboxes.

This list is EDITABLE by the user.

Let's say:

Option A

Option B

Option C

Option D

(keep in mind, the names and number of items in the list can change!)

There are two fields:

Field A

Field B

Field A is used to select Options from the value list. This is generally set once.

Field B is used to re-select the same options at a later time. Generally at indeterminate times (not all at once) and not in any order and definitely not in te same order as those made in Field A.

I would like to have a calculation field to flag the user when all of the items selected in Field A have also been selected in Field B.

Since the Options are adjustable by the user, I cannot hard-encode the value list item names into a calculation.

Also, the "If (Field A = Field B,...)" command does not work because that is dependent on what order the user selected each option.

So Field A may contain:

Option B

Option A

Option D

But Field B may contain:

Option A

Option D

Option B

The two fields do not equal each other, but all selected checkboxes of Field A **ARE** selected in Field B.

I've tried using different methods, such as Case, Replace, Substitute, but cannot figure out how to make this work.

I'm using FMP 6.0v4

Thanks!

Paul

FileMaker Version: 6

Platform: Mac OS X Jaguar

Link to comment
Share on other sites

Here's one option. Create two value lists (FieldA and FieldB), one based on id::FieldA and one on id::FieldB, where id is a self-relationship from serial number to itself. Then create a calculated text field of: Case( ValueListItems( Status(CurrentFileName), "FieldA" ) = ValueListItems( Status(CurrentFileName), "FieldB" ), "Match" ). Put this calculated field on your layout to flag the user.

Due to the way value lists are indexed, you'll have to refresh the calc after making a change, often done by entering Find Mode, then going back to Browse Mode. You can do this either by adding a Refresh button to the layout or scripting each selection by putting a transparent button over each option and attaching them to scripts like:

Set Field [FieldA, Substitute(Case(PatternCount(FieldA, "A"), Substitute(FieldA, "A", ""), FieldA & "

Link to comment
Share on other sites

This topic is 6496 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.