syntax multichoice

Monjoie Dominique asked on March 9, 2017 10:30

Hi,

In a form, I have a multichoice. Following the chosen options, some other fields are displayed or not.

When I used Field.Value == "1" or Field.Value == "2", it works when only one option is chosen. When both are clicked, anything is displayed.

I try Field.Value LIKE "%1%" and Field.Value LIKE "%2%" but all the conditional fields are always displayed.

Does anyone have the correct syntax to use to display one or more fields following the chosen options.

Thanks.

Correct Answer

Felix Planjer answered on March 9, 2017 13:13

The values are actually save in the database with a separator. I think it is a pipe ('|') character. So that is why the Field.Value == "1" will not work when more than one item is selected (the value will be something like '1|2', which is not equal to '1'.

The LIKE statement won't work because it is a SQL statement and not a macro/k# statement. Could you try Field.Value.Contains('1') as the statement?

0 votesVote for this answer Unmark Correct answer

   Please, sign in to be able to submit a new answer.