|
Julian,
You wish the query to display either of the following
alternative results, based upon selection made in a single combo box.
(a) One particular Organization (GP Practice)
(b) Other organizations (excluding GP Practice)
(c) All organizations.
Sample query given below will get you the desired
results. T_Org is the name of table. CboGrp is the name of combo box on form
F_Org. Row source Type for CboGrp is Value List, while its Row Source
is the following string.
"GP
Practice";"Others";"ALL"
(The query is to be run only when the form is
open.)
Note - Whenever a query involves parameter input
(whether through user prompt or reference to a form's control), it is considered
a highly desirable practice to incorporate a parameters clause at the
beginning, with explicit declaration of data-type. It becomes all the more
crucial in case of date type data.
Sample db named QueryComboCriteria_2K.zip,
demonstrating the above approach, has been uploaded to Files section of this
group.
Best wishes,
A.D.Tejpal
--------------
====================================
PARAMETERS [Forms]![F_Org]![CboGrp] Text ( 255 );
SELECT T_Org.* FROM T_Org WHERE (((IIf([Type]="GP Practice","GP Practice","Others"))=[Forms]![F_Org]![CboGrp])) OR ((([Forms]![F_Org]![CboGrp])="ALL")) ORDER BY T_Org.Type; ====================================
Please zip all files prior to uploading to Files section. YAHOO! GROUPS LINKS
|
- [AccessDevelopers] Parameters for query Julian Flint
- Re: [AccessDevelopers] Parameters for query A.D.Tejpal
- Re: [AccessDevelopers] Parameters for query Julian Flint
