IIf statement used for sorting data based on option group

dionem

New member
Local time
Tomorrow, 05:47
Joined
Jan 11, 2006
Messages
7
Hi all,

My problem is as follows:

I am trying to generate a report, which is based on a query, which references a form that has an option group containing four options.

I want to sort the data according which option group radio button has been selected (they the values of 1,2,3,4).

Originally there were only 2 options and the query said (in SQL view):

ORDER BY IIf(Forms!frm_08_reportsort!opt_sort_by=1,TBL_AccountManager.Name,TBL_SiteContactDetails.SchoolName),

This works fine for 2 options, but I can't figure out what command i should use for more than 2 options :confused:

Any help would be much appreciated :)
 
You can nest IIF() like this:-

IIf(Condition1, UseA, IIf(Condition2, UseB, IIf(Condition3, UseC, UseD)))
.
 
Thanks for your help guys - with ur advice i have got it sorted :)
sorry for delayed reply - had to work on other stuff for rest of week
 

Users who are viewing this thread

Back
Top Bottom