Microsoft Access Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMicrosoft Access Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old January 10th, 2005, 11:14 AM
mezza1 mezza1 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 12 mezza1 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 28 sec
Reputation Power: 0
Unhappy Multiple Tri-State Check box filters

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....
Attached Files
File Type: zip triplestate_2000.zip (44.0 KB, 208 views)

Reply With Quote
  #2  
Old January 10th, 2005, 04:30 PM
lwells lwells is offline
Contributing User
Dev Articles Novice (500 - 999 posts)
 
Join Date: Sep 2004
Posts: 632 lwells User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 21 h 59 m 38 sec
Reputation Power: 5
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

Reply With Quote
  #3  
Old January 11th, 2005, 03:49 AM
mezza1 mezza1 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 12 mezza1 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 28 sec
Reputation Power: 0
Smile

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:
Originally Posted by lwells
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

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft Access Development > Multiple Tri-State Check box filters


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT