Can multiple check boxes set another field value?

For HanDBase related topics that are not specific to one platform.

Can multiple check boxes set another field value?

Postby jfh » Fri Feb 13, 2015 7:52 pm

In a record I have 4 checkboxes labeled A, B, C, D. In theory, only one can be selected.

I have a text field called Result

I would like Result to contain "Result A" if box A is checked, "Result B" if B is checked , etc. The actual text for the results is a field in another database.

Ideally, Result would be set to "Error" if more than one box is checked

I was hoping I could do this with a conditional field, but I can't see how to specify more than one condition.

Is it possible to do what I want?
Posts: 17
Joined: Tue Jan 25, 2011 7:29 pm

Re: Can multiple check boxes set another field value?

Postby dhaupert » Sat Feb 14, 2015 10:05 am

Hi there,

Most definitely it's possible! The trick is to combine conditional fields to evaluate more than one. Here's an example:

Field 1: Result A
Field 2: Result B
Field 3: Result C
Field 4: Result D

Field 5: Cond1 if Result A is equal to 1, then output is "Result A", else output is zero
Field 6: Cond2 If Result B is equal to 1, then output is "result B", else output is Cond1 value (this is the key!)
Field 7: Cond3 If Result C is equal to 1, then output is 'result C', else output is Cond2 value
Field 8: Cond4 If Result D is equal to 1, then output is 'result D', else output is Cond3 value

So the above will allow you to chain the values together so to speak and pass the result of one to the next. Field 8 should show you the value that was checked, assuming just one is checked. The only thing- this will not tell you if there was more than one box checked. To do this we'll add two more fields:

Field 9: Sum (calculated) with the formula Field 1 + Field 2 + Field 3 + Field 4. This should be a value from 0 to 4 depending on what boxes were checked.
Field 10: Final Value (conditional) if Field 9 less than or equal to 1, then value is Cond4 value else value is 'Error!'

Field 10 should give you the final value you need. Hope this all makes sense. One question I have for you- why not just use a popup with 5 choices- Results A-D and Error with Error being the default value?
Posts: 4111
Joined: Tue May 26, 2009 11:51 am

Return to HanDBase General Discussion

Who is online

Users browsing this forum: No registered users and 2 guests