About query forms
Query forms allow users to create a filter to specify the collection they want to retrieve. The filter can be temporary (existing as long as the query form is open), or it can be saved by the user, to be used again.
Query forms are split horizontally into two panes. The upper pane contains tabs for primary criteria and additional criteria. The lower pane displays the returned results set in a grid.
Each IDO must be associated with a unique query form.
Query forms are typically created in association with a particular form or component:
- For forms, query forms are usually assigned at the time the form is created, though they can be added or reassigned later.
- Query form assignments are
made or changed:
- For forms, on the “Form” properties sheet, using the “Behavior > Filter Form” property setting
- For components, only by
using a component class, with valid settings for
“Behavior > Add/Details and Find
Form > Find Form” in the component class definition
注意:When assigning a query form to a component class, you must also set the “Property” attribute in the “Behavior > Add/Details and Find Form” group.
The result set displayed on the query form can be returned to the calling form or to the calling component. The result set becomes the current collection in the calling form. A selected IDO item in the result set becomes the current item or current component value.
Query forms cannot be linked.
Specifying criteria on query forms
When you create a query form using the WinStudio wizard, you specify:
- What IDO properties are to be included
- Whether they are placed on the “Primary Criteria” tab or the “Additional Criteria” tab
Primary criteria are those properties considered to be the most important criteria or the criteria users will most likely want to search on. Additional criteria are all other criteria that users might want to search on but not thought likely to be their first choices.
When performing a query:
- Users are not required to specify any criteria - though that rather defeats the purpose of performing a query. Any primary criteria not specified includes all possible records in the return results. So, if you perform a query without specifying any filter criteria, then all records are returned in the result.
- Primary criteria have an assumed Boolean AND relationship. That is, items are retrieved from the database only if they meet all the specified criteria.
- Additional criteria are optional and can be joined by either AND or OR, depending on how you want to submit the query. If multiple criteria are joined by OR, records are returned if they meet any one of the criteria.
You enter query criteria by selecting an operator and a value for each property listed on the “Primary Criteria” tab. You can use the wildcard character (by default, the asterisk).
To add other properties, with appropriate operators and values, to the filter, you can also use the “Additional Criteria” tab.
To display the results of your query, click the “” button. The results then display in the “Results” pane.
To close the query form and optionally return the results to any calling form or component, click “”.