Opening Access Parameter queries

Access Parameter queries can be opened only when you open an Access database via ODBC. Make sure you have an ODBC data source set up for your Access database before attempting this procedure. See Setting up an ODBC data source.

To open an Access Parameter query

  1. In Crystal Reports, choose Options from the File menu.

    The Options dialog box appears.

  2. Click the Database tab.
  3. Ensure that the Stored Procedures check box is selected.

    Selecting "Stored Procedures" automatically displays any available stored procedures when you log on to an ODBC data source. Crystal Reports treats Access Parameter queries much like it treats SQL stored procedures. So, to use a Parameter query, the Stored Procedures check box must be selected.

  4. In addition, you can specify Table name LIKE and Owner LIKE options if you wish.
    • "Table name LIKE" is based on the SQL LIKE clause. This option allows you to specify the kinds of table names you want to appear in the Choose SQL Table dialog box. You can use the underscore character (_) or the percent sign character (%) as wildcards with this function. The underscore character specifies any single character, while the percent sign signifies any character string. For example, DAV_ matches DAVE only, while DAV% matches DAVE and DAVID. Table name LIKE C% displays only those tables that have a table name beginning with the letter C.

    • "Owner LIKE" is also based on the SQL LIKE clause. Owner LIKE allows you to select the Owner (or Creator or Alias) of the table, not the table name itself. For example Owner LIKE C% displays only those tables that have an owner beginning with the letter C.

  5. Click OK to exit the Options dialog box.
  6. On the Start Page, click Blank Report.
  7. Locate and select the ODBC data source that contains the Access Parameter query you want to use.
  8. Highlight your Parameter query in the Stored Procedures folder, click the > arrow, and then click OK.
  9. Create your report using the fields in the Parameter query.
  10. On the Standard toolbar, click Refresh to update the report's data.

    The Enter Prompt Values dialog box appears.

  11. Assign a value by typing into the field and then click OK.

    Your report appears. Only the records that satisfy the parameter values you specified in the Enter Parameter Values dialog box are used in your report.