Hi.
Here is an expression in my query:
incident: IIf([tbl_attendance].[att_st]=-1,"Street",IIf([tbl_attendance].[att_wk]=-1,"work",IIf([tbl_attendance].[att_illness]=-1,"Illness",IIf([tbl_attendance].[att_sport]=-1,"Sport",IIf([tbl_attendance].[att_si]=-1,"Self Inflicted",IIf([tbl_attendance].[att_rta]=-1,"RTA",IIf([tbl_attendance].[att_home]=-1,"Home",IIf([tbl_attendance].[att_school]=-1,"School",IIf([tbl_attendance].[att_other]=-1,"Other",IIf([tbl_attendance].[att_st] And [tbl_attendance].[att_wk] And [tbl_attendance].[att_illness] And [tbl_attendance].[att_sport] And [tbl_attendance].[att_si] And [tbl_attendance].[att_rta] And [tbl_attendance].[att_home] And [tbl_attendance].[att_school] And [tbl_attendance].[att_other]<-1,"Multiple"))))))))))
OK, what I am trying to achieve is the following:
ALL the fields shown above are fed to radio buttons on a form. If it is checked, the value is -1. IF the value for a field is -1, then the description shows on the query result. That's the easy part.
Now, if the value of ALL these, or more than one of these per record is -1, then I would like the description to say 'Multiple'.
So, if more than one radion button is selected on the form, this should show as 'multiple'.
Can anybody look at the code and tell me where I am going wrong at the last IIF statement please?
Many thanks is advance,
-NEIL
Here is an expression in my query:
incident: IIf([tbl_attendance].[att_st]=-1,"Street",IIf([tbl_attendance].[att_wk]=-1,"work",IIf([tbl_attendance].[att_illness]=-1,"Illness",IIf([tbl_attendance].[att_sport]=-1,"Sport",IIf([tbl_attendance].[att_si]=-1,"Self Inflicted",IIf([tbl_attendance].[att_rta]=-1,"RTA",IIf([tbl_attendance].[att_home]=-1,"Home",IIf([tbl_attendance].[att_school]=-1,"School",IIf([tbl_attendance].[att_other]=-1,"Other",IIf([tbl_attendance].[att_st] And [tbl_attendance].[att_wk] And [tbl_attendance].[att_illness] And [tbl_attendance].[att_sport] And [tbl_attendance].[att_si] And [tbl_attendance].[att_rta] And [tbl_attendance].[att_home] And [tbl_attendance].[att_school] And [tbl_attendance].[att_other]<-1,"Multiple"))))))))))
OK, what I am trying to achieve is the following:
ALL the fields shown above are fed to radio buttons on a form. If it is checked, the value is -1. IF the value for a field is -1, then the description shows on the query result. That's the easy part.
Now, if the value of ALL these, or more than one of these per record is -1, then I would like the description to say 'Multiple'.
So, if more than one radion button is selected on the form, this should show as 'multiple'.
Can anybody look at the code and tell me where I am going wrong at the last IIF statement please?
Many thanks is advance,
-NEIL