PeterWieland
Registered User.
- Local time
- Today, 10:43
- Joined
- Sep 20, 2000
- Messages
- 74
Hi,
I have a form that I use to provide the criteria for a query. There are 2 check boxes that are used to exclude 2 particular categories from the query.
This is what I have in the criteria field of the query:
Not Like IIf([Forms]![frmSubjects]![checkIncludeSubject1]=No,"Subject1","") And Not Like IIf([Forms]![frmSubjects]![checkIncludeSubject2]=No,"Subject2","")
This part works fine.
I want to change the way the system works so that a report can be generated as above (i.e list all records, but choose to leave 1 or 2 items out), or to select individual subjects from a combo box.
I have set up the form with an option group which hides either the combo box or the check boxes, but I can't work out how to include the combo box in the criteria.
I think I need a statement that would read like this:
If Option 1 selected, then list records that MATCH combobox, else if Option 2 selected, list records that DO NOT MATCH those indicated by the check boxes, if NOT checked.
Hope this makes sense. I have tried to write this with nested IIf statements, but I get a message that the expression is too complex.
Thanks in anticipation
Peter
I have a form that I use to provide the criteria for a query. There are 2 check boxes that are used to exclude 2 particular categories from the query.
This is what I have in the criteria field of the query:
Not Like IIf([Forms]![frmSubjects]![checkIncludeSubject1]=No,"Subject1","") And Not Like IIf([Forms]![frmSubjects]![checkIncludeSubject2]=No,"Subject2","")
This part works fine.
I want to change the way the system works so that a report can be generated as above (i.e list all records, but choose to leave 1 or 2 items out), or to select individual subjects from a combo box.
I have set up the form with an option group which hides either the combo box or the check boxes, but I can't work out how to include the combo box in the criteria.
I think I need a statement that would read like this:
If Option 1 selected, then list records that MATCH combobox, else if Option 2 selected, list records that DO NOT MATCH those indicated by the check boxes, if NOT checked.
Hope this makes sense. I have tried to write this with nested IIf statements, but I get a message that the expression is too complex.
Thanks in anticipation
Peter