IF querey with counts

  • Thread starter Thread starter 8am81
  • Start date Start date
8

8am81

Guest
Hey, I dont know much about Access but i need a little help with my queries.

I need to make it so that if a specific tick box was ticked, a number would be counted. This will be the case with many many tick boxes. What wud I put as the criteria.
Exmaple:
I wanted it so that every time I clicked a specific tick box (made with a yes/no) the number 2 was added to every other tick box that was selected (but those tick boxes may be a different number). It would be counted all up to a particular number.

I hope you get what I mean. It's difficult to explain.

Hope you can help

Thanx
8am81
 
Well, it would be a nasty nested IIF, but it could be done.
How ever it could also be done in multi-queries, maybe easier to maintain. Create a query that returns the check boxes with the primary key, and use one IIF for each check box, something like:
CB1: IIF ([Checkbox1] = true,2,0)
Then the second based on the first could just sum them up or whatever.
 
Thanx a lot. Can i ask what the 0 at the end of the expression is for?
 
If the checkbox is not checked the value will equal 0 instead of 2.
 

Users who are viewing this thread

Back
Top Bottom