How to Make Dynamic Queries

businessman

Registered User.
Local time
Today, 00:20
Joined
Jun 19, 2006
Messages
79
I have several fields that have a drop down list. Say the Field is called "Age" and I have choices in the drop down menu as 1, 2, 3, and 4. How do I create a query that would accept input from the user to show 2 of the 4 or 1 of the 4 or all of the choices using one query that has checkboxes, and possibly using a form to do so. I have a form that has a list of all entries. Now I just need to make it able to filter based on user input.

Say I have checkboxes for 1, 2, 3, 4, and all choices. Can a list filter only what I check? Can I create a form that would have all the choices on it and just click a button that says "submit" and have it filter, or print the form. How do you get the checkboxes to filter when checked, but not when unchecked? Where does Access store the true/false, on/off, yes/no responces that come from the checkbox? Is there a variable that gets set to a 1 or a 0 based on the status of the box?
 
For this kind of thing you'll probably need to use SQL embedded in VBA code. Sounds scary but it's not so bad to get the hang of, I found a very good tutorial here:
http://www.fontstuff.com/access/acctut14.htm
which basically walks you through something very similar to what it sounds like you are trying to do. Hope it helps,

Bogzla
 

Users who are viewing this thread

Back
Top Bottom