-----Original Message-----
Juan,
It depends exactly what you mean. If you mean you want the user to be
able to select NA *or* EU *or* AP *or* All, then your 4 option buttons
can be part of an Option Group on your form. But if you need to allow
for the possibility, for example, of NA *and* AP but *not* EU, or some
such combination, then the option buttons (or, preferably, checkboxes)
will need to be stand-alone. Either way, they can't directly return the
text of your criteria, so you will have to do some sort of conversion or
reference. So, let's say it is the first scenario, so the 4 option
buttons are in an option group, with the values 1, 2, 3, and 4. Ok, one
way to handle this is to make a simple 2 field 3 records table, with one
column containing 1, 2, 3 and the other containing NA, EU, AP. Then,
you can add this table to your query, join it on the Region field to
your existing table, and then apply your criteria to the RegionNumber
field of the lookup table. The criteria will look something like this...
[Forms]![NameOfForm]![YourOptionGroup] Or
[Forms]![NameOfForm]![YourOptionGroup]=4
Another approach is to make a calculated field in your query, based on
the existing region field, like this...
RegionNumber:
Switch([Region]="NA",1,[Region]="EU",2,[Region] ="AP",3,True,4)
and then put your criteria [Forms]![NameOfForm]! [YourOptionGroup] into
this column of the query.
--
Steve Schapel, Microsoft Access MVP
Hello Steve,
I have something similar to this, so trying to understand
your suggestion. let say I have a form and I add option
buttons. NA, EU, AP, and ALL. You mention enter your query
criteria values in here. What do you mean by this? I
understand changing in the query the criteria but how in
the form.
I export queries for those for regions, so I don't want
user to type in NA for every query.
Please advise, would appreciate the help.
Thanks
JUAN
.