Query templates enable you to save Select or SQL Select statements as templates and reload them. This saves you the trouble of having to rebuild a query each time you want to use it. Both the Select and SQL Select dialog boxes have Load Template and Save Template options to enable you to do this easily. Query templates are useful for re-creating a query with an updated version of the table used in the original query, or for executing a query on a table that has the same fields as the table on which the query statement was created.
Loading a Template
You can load any saved query template.
To load a query template:
- In the Select or SQL Select dialog boxes, lick the Load Template button. The Load Dialog From Query File dialog box displays. It lists the .QRY files.
- Select the .QRY file you want to use, and click Open. The Select or SQL Select dialog box displays with the values from the template already filled in. Simply execute your query to create the query browser.
Renaming a Template
Rename a template by selecting and clicking the template name; enter a new name up to 64 characters.
Saving a Template
After you have finished writing your Select or SQL Select query, you can save the query as a template.
To save a query as a template:
- In the Select or SQL Select dialog boxes, click the Save Template button to save the query to a template, or query file. The Save Dialog to Query File dialog box displays.
- Give the query file a name, select a folder, and click Save. Query files are saved with a .QRY extension and are saved in the directory specified in the Directories preferences.
Deleting a Template
To delete a template:
- Select the template name and press the Delete key. A dialog box displays prompting you to confirm or cancel the operation. If no templates of the given type exist, a button to restore a default template displays.