Question : Set Status with Multiple Conditions

hi,
I am wondering if someone can give me some advice on how to accomplish the following:
In my qry I have:
Area   ItemID   Forms   FormStatus   ItemStatus
1A1     123AB   2A         Complete
1A1      123AB   1A         Complete
1A1     123AB   1B         Incomplete
1B2         23ABC  1A         Incomplete
1B2       23ABC   1B         Complete
1C3      345CDE   1B       Complete
1C3      345CDE    2A      Complete
and so on...
Here is what I am trying to do:
For every itemID if there is a form  A that is incomplete, set the Status to "Not Ready". If there is a form B that is Incomplete but the form A is complete, set the Status to "Ready". If both forms A and B are complete, set the status to "Complete."

For example, for 123AB the A forms  are complete and there is a B form that is incomplete, so for item 123AB the status should be set to: "Ready".
For  23ABC, the A form is incomplete so the status should be set to: "Not Ready"
For 345CDE, since both forms are complete the status should be set to: "Complete"
Each item can have 1 or more forms. The forms can either be A or B types.
I am trying to do this in a query through nested IIF statements but I can't quite get it. :(
Can anyone please give me an advice on how to accomplish this? Please?

Thank you,
CS

Answer : Set Status with Multiple Conditions

Ok ... without getting to detailed ... my approach would be a VBA Function.  Basically pull a Recordset filtered to each ItemID.  Then test for the existence of the FormStatus for Type "A" and "B".  Then issue some logic to determine and set the ItemStatus based on your comments above.

Prehaps another Expert will have something in SQL if you post what you have thus far.

ET
 
Random Solutions  
 
programming4us programming4us