|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
I am trying to create a kind of troubleshooting form and queries that returns all records based on what has been selected on the form.
I have a form, currently 3 questions, with possible Yes/No/Null (tri-State) responses. I have a query that looks at the value of only '1' of these check boxes and returns records based on what has been selected. Like the sample query below below; SELECT tblMembership.lngMemberID, tblMembership.strFirstName, tblMembership.strLastName, tblMembership.dteMembership_Com, tblMembership.ysnActiveMember FROM tblMembership WHERE (((tblMembership.ysnActiveMember)=[forms]![frmRun_Active_Or_Inactive_query]![chkActivity])) OR (((([tblMembership].[ysnActiveMember]) Like [forms]![frmRun_Active_Or_Inactive_query]![chkActivity]) Is Null)); But i have 3 check boxes (possibley will have up to 10) and i need them to return all possible records based on all the selections made accross all of them, do i have to use each one as subquery to return the correct records..? I have used the sample db attached, but required to add extra check boxes, to filter the returned records. The source table will have the same amount of fields as the form to filter. Any help would be great.... |
|
#2
|
|||
|
|||
|
Mezza1
This should be a fairly easy task to perform. My recommendation would be to make a function that would build your query sql based on the selected checkboxes. If you provide just a little detail I will post you some code that will perform this task. 1) You said your table will have the same number of fields to query from. So I gather that each check box will filter a specific field in your table based on the True/False/Null conditions. Is this correct? 2) You mentioned possibly 10 check boxes, is this for the ten fields to query in your table? 3) What is the data type for each field your checkboxes will filter on. lwells |
|
#3
|
|||
|
|||
|
Hi Again...
as normal i worked through the problem and got it working, using the 'IN' subqueries, and it works quite well, as this is just a very small table, that lists possible 'Exemptions' for the FOI Act. It would be nice to get it to work in a function, but i am on a tight deadline, and need to get this up and running and deployed on sql asap, and i am not overally familiar with VB. Thanks for your help. hopefully speak again soon. Mezza1 Quote:
|
![]() |
| Viewing: Dev Articles Community Forums > Databases > Microsoft Access Development > Multiple Tri-State Check box filters |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|