View Single Post
  #3  
Old May 28th, 2010, 03:17 PM posted to microsoft.public.access.forms
Al Campagna[_2_]
external usenet poster
 
Posts: 1,462
Default Check boxes to run queries

Natalie,
Check out Option Groups in Access Help.
It allows you to group those 5 check boxes into a group, where
only one check box can be selected at a time, and gives each selection a
different numeric value. For ex. [optCountry].
The query can then determine that IF optCountry = 1 then it's "USA,"
or IF optCountry = 4 it's "Canada" etc...

BUT...
Now that will work... but it's clumsy... in that the query must
interpret
(using IFs) 5 numeric values to a textual equivalent. What happens when you
have 6 countries? 8 countries?
Each time you'll have to re-"IF" the query for the added numeric values.

I would suggest a combo box instead, (ex. cboCountry) with a Value List
of
all the countries as the RowSource. Then the query can take the combo value
directly in it's
SQL statement.
Country = Forms!SomeFormName!cboCountry
If another country is added... just add it to the combo's Value List,
and that's it...
nothing else to do.
--
hth
Al Campagna
Microsoft Access MVP 2007-2009
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."

"Natalie" wrote in message
news
Hi,

I want to use check boxes to choose criteria. I was to return a table for
the following data:

Invoice number, Customer number country, part number, qty, value etc.

There are 5 countries, I want to have a check box for each so we can
choose
which ones to include, and then click GO.

How do I do this? I am new to this.

Thanks

Natalie