I have a checkbox on a layout region, which dynamically changes the choices depending on the value of another field.
I have a combobox field, Reason, which stores reasons for absence, options being “Vehicle Breakdown”, “Sick”, “Family Emergency”, “Jury Duty”, etc.
When the value is “Sick”, the checkbox (which stores details of supporting documentation) has the options “None”, “Self Certificate” and “Doctors Certificate”.
When the value is “Vehicle Breakdown”, the checkbox has options of “None”, “Evidence Produced”.
When the value is “Jury Duty”, the checkbox has one option, “None”.
This all works as it should, but when a user selects “Sick” in the combobox, and then changes the value to “Vehicle Breakdown”, the old options don’t disappear. What is displayed to the user are options of “None”, “Evidence Produced” and “Doctors Certificate”. The third option cannot be selected, so this is a bug with the checkbox “not clearing it’s lines” when the choices change. This can be seen when I put a border round the checkbox, it overwrites half of the third option. This also happens when I use a hide when formula. The last one or two options are always left intact, when the whole field should be hidden.
This is for a dialog box, so a layout region really must be used, due to other constraints when this is displayed.
Anyone, any ideas??
Using different checkbox fields is not an option either, as there may be many different reasons for absence, which are added dynamically. Also I may still have problems hiding the old checkbox field.
INFO:
My “Reason” field is a Combobox, Editable and has “Refresh Fields On Keyword Change” selected. This is the formula for it’s choices:
rs:=@Unique(@DbLookup(“”;“”;“vwSystemLookup”;“ShiftReason”;2));
@If(@IsError(rs);
“NO REASONS DEFINED”;
rs)
My “Documentation” field is a Checkbox, Editable and has “Refresh Choices On Document Refresh” selected. It has 1 column. This is the formula for it’s choices:
docs:=@Unique(@DbLookup(“”;“”;“vwSystemLookup”;“ShiftReason”+Reason;2));
@Trim(“None”:@If(@IsError(docs);“”;docs))
My options are stored in documents in a “lookup view” and have the following values:
ShiftReason
Operator Error|1
Sick|2
No Show|3
Vehicle Breakdown|4
Previous Client Emergency|5
Family Emergency|6
Late Request|7
Weather Emergency|8
Jury Duty|9
ShiftReason1
(no values)
ShiftReason2
Self Certificate|1
Doctors Certificate|2
ShiftReason3
(no values)
ShiftReason4
Evidence Produced|1
ShiftReason5
(no values)
ShiftReason6
Evidence Produced|1
ShiftReason7
Evidence Produced|1
ShiftReason8
(no values)
ShiftReason9
Evidence Produced|1
The “Documentation” field (checkbox) also has a Hide-When formula:
!Reason=“2”:“4”:“5”:“6”:“7”:“8”
TIA
Charlie