check Box for Criteria in make table query

smith844

Registered User.
Local time
Today, 15:02
Joined
Jul 29, 2005
Messages
13
having used a query to generate data from a set of records where i can select the criteria (they are two letter abrv and are in a single field in the table but there may be multiple criteria). As I would like others to do it without using the query my first thought was a form with a series of check boxes tick for inclusion in the query or not. As i have built the query am I looking at changing that or taking it all into VB and using some code to pull the relavant 'ticks' across............ and how the hell would i do that......


many thanks in anticipation......
 
If I understand you correctly, you can use IIF statements in your query design to look for checkboxes on your search form that are True (checked). In the criteria for that field in your query:
= (iif(Forms![frmMyForm]![chkMyControl] = True,"XX","*"))

Where "XX" is the two-letter string you are trying to match by checking that box on the form.

You mention "multiple criteria". Depending on exactly what your data is and how many choices you're going to give them in setting the query up, this might not be the easiest way. If these two-letter strings are state abbreviations, for example, you're looking at 50 checkboxes and a LOT of IIF statements...


--Frightened Mac
 

Users who are viewing this thread

Back
Top Bottom