Check Boxes - How do I use them !!!???!!!

  • Thread starter Thread starter Jacob Frankham
  • Start date Start date
J

Jacob Frankham

Hi there

I have put 3 unbound check boxes on my form.

They are:

[] High
[] Medium
[] Low

The user has the option of selecting any number of the three.
They are all SELECTED by default.

How do I include the selected values in my query, ie:

I have a query which returns a set of fields, one of which is 'risk' and can
be either 'High', 'Medium' or 'Low'.

I want the query to produce only those rows where 'risk' is equal to the
selected checkboxes, eg if Medium & Low were checked then I would not want
to see any rows where 'risk' was High

Hope someone can help, I am being completely braindead today

Cheers

Jake
 
For the parameter of the field in the query that uses the High, Medium, Low try the
following. It assumes that at least one of the check boxes MUST be checked.

IIF(Forms!MyForm!chkHigh, "High", IIF(Forms!MyForm!chkMedium, "Medium", "Low")) Or
IIF(Forms!MyForm!chkMedium, "Medium", IIF(Forms!MyForm!chkLow, "Low", "High")) Or
IIF(Forms!MyForm!chkLow, "Low", IIF(Forms!MyForm!chkHigh, "High", "Medium"))

The above should be all on one line. The result has the possibility of looking funny, but
works. For example, if only High is checked you will get

"High" Or "High" Or "High"
 
Back
Top