Hi,
I recently had advice about updating a number variable as long as the combobox had a value of "Yes" or "No" (in other words not blank.
i settled on this code as a Named Formula
varBinCalcCheck =
If(!IsBlank(cmbQuestionOne.Selected), 1, 0) +
If(!IsBlank(cmbQuestionTwo.Selected), 2, 0) +
If(!IsBlank(cmbQuestionThree.Selected), 4, 0) +
If(!IsBlank(cmbQuestionFour.Selected), 8, 0) +
If(!IsBlank(cmbQuestionFive.Selected), 16, 0)
;
Which i then used in the On Change event using fx code to send a warning depending on the number value of: varBinCalcCheck.
I have tried to adapt the code by amending to check if the value of the Combobox = "No" but i am getting an error - saying about a Record and Test error.
The code i have tried is:
If(!IsBlank(cmbQuestionOne.Selected && cmbQuestionOne.Selected ="No"), 1, 0) +
so i would have had:
varBinCalcCheckNoSelected =
If(!IsBlank(cmbQuestionOne.Selected && cmbQuestionOne.Selected ="No"), 1, 0) +
If(!IsBlank(cmbQuestionTwo.Selected && cmbQuestionTwo.Selected ="No"), 2, 0) +
If(!IsBlank(cmbQuestionThree.Selected && cmbQuestionThree.Selected ="No"), 4, 0) +
If(!IsBlank(cmbQuestionFour.Selected && cmbQuestionFour.Selected ="No"), 8, 0) +
If(!IsBlank(cmbQuestionFive.Selected && cmbQuestionFive.Selected ="No" ), 16, 0)
;
Thereby hoping to get a count of Comboboxes that + "No" (using Binary)
So if i had
cmbQuestionOne = "No"
cmbQuestionTwo = ""
cmbQuestionThree = "No"
cmbQuestionFour = "Yes"
cmbQuestionFive = "No"
Then
varBinCalcCheckNoSelected = 21
Please could someone suggest how to fix this code so it can equate if the combobox value ="No" NOT just "Non Blank"
varBinCalcCheckNoSelected =
If(!IsBlank(cmbQuestionOne.Selected), 1, 0) +
If(!IsBlank(cmbQuestionTwo.Selected), 2, 0) +
If(!IsBlank(cmbQuestionThree.Selected), 4, 0) +
If(!IsBlank(cmbQuestionFour.Selected), 8, 0) +
If(!IsBlank(cmbQuestionFive.Selected), 16, 0)
;
Thanks