Constraint to prevent zeros in two fields

Hello community!
I’m struggling to write a constraint, hoping to find some answers here.
This form collects data on activities and numbers of participants. I’ve split men and women in 2 different fields. How can I write a constraint so that if the “a1 - number of women” is equal to zero, then “a2 - number of men” cannot be equal to zero too?
I’ve tried using a simple note advising the data collector to correct the numbers if that is the case, but I want a constraint that blocks going further if 2 zeros are entered.
Thank you for your help!
Effy

Welcome back to the community @effy1988! Maybe you could do the same as outlined in the image shared below:

In the survey tab of your xlsform:

Data entry screen as seen in Enketo: when a condition is not satisfied

Data entry screen as seen in Enketo: when a condition is satisfied

Image 3

Data entry screen as seen in Enketo: when a condition is satisfied

Image 4

Data entry screen as seen in Enketo: when a condition is satisfied

Image 5

Reference xlsform:

Constraint.xlsx (9.7 KB)

Thanks a lot for the quick reply @Kal_Lam ! Exactly what I was looking for.
Have a good week,
Effy

1 Like