padlocked17
Registered User.
- Local time
- Today, 17:13
- Joined
- Aug 29, 2007
- Messages
- 275
I have a combo box that selects a record on a form.
The combo box is based off of a query and I want to be able to filter a field on the query that the combo box is being populated by.
The problem is that it's a yes/no field I want to setup criteria for and I haven't been able to get an IIf or Switch statement to work correctly.
The issue is that I want to filter the combo box from either two separate combo boxes and a check box or from a group of radio buttons or a combination of the two.
The idea was to have a drop down with a list of enrolled members. The second drop down would requery the first one and would allow you to select a class. The third drop-down would allow you to select, "All", "Students", or "Teachers". The check box would then allow you to view archived members who have a "Yes" in the Graduated column of the query.
The class drop-down I have figured out fine on how to filter. The issue lies within the selection of a member type. I tried using radio buttons for "All", "Students" and "Teachers" but the problem was when I built my IIf or Switch statement, I couldn't figure out how to make the "All" values not put any criteria into the query. My statements looked like below:
Neither worked out. Essentially I am trying to set criteria for a Yes/No column, and I can't get it to work correctly.
I am requerying after update of the radio button option group and/or the combo box filter.
Any ideas?
The combo box is based off of a query and I want to be able to filter a field on the query that the combo box is being populated by.
The problem is that it's a yes/no field I want to setup criteria for and I haven't been able to get an IIf or Switch statement to work correctly.
The issue is that I want to filter the combo box from either two separate combo boxes and a check box or from a group of radio buttons or a combination of the two.
The idea was to have a drop down with a list of enrolled members. The second drop down would requery the first one and would allow you to select a class. The third drop-down would allow you to select, "All", "Students", or "Teachers". The check box would then allow you to view archived members who have a "Yes" in the Graduated column of the query.
The class drop-down I have figured out fine on how to filter. The issue lies within the selection of a member type. I tried using radio buttons for "All", "Students" and "Teachers" but the problem was when I built my IIf or Switch statement, I couldn't figure out how to make the "All" values not put any criteria into the query. My statements looked like below:
Code:
Switch([Forms]![frmHome]![fraFilterSelect]=1,"",[Forms]![frmHome]![fraFilterSelect]=2,No,[Forms]![frmHome]![fraFilterSelect]=3,Yes)
Code:
IIf([Forms]![frmHome]![fraFilterSelect]=1,"",IIf([Forms]![frmHome]![fraFilterSelect]=2,No,IIf([Forms]![frmHome]![fraFilterSelect]=3,Yes,"")))
Neither worked out. Essentially I am trying to set criteria for a Yes/No column, and I can't get it to work correctly.
I am requerying after update of the radio button option group and/or the combo box filter.
Any ideas?