Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2003
    Location
    Spokane, WA
    Posts
    81

    Question Unanswered: Query Criteria in Reports

    I have a report based upon a query using a certain criteria.

    Is there a way for the report to show what criteria is requested via the query?

    For example you run the report and it asks for a name.
    You type in "Smith" and the report gives you all the records with "Smith". How can I show "Smith" (the criteria) in the report header?

  2. #2
    Join Date
    Jul 2003
    Posts
    73
    How are the user's choosing which report to view? If they are running reports from a Form (I.e. Report Menu), there may be a better way than parameters to limit your report.

    Instead of just putting [Enter the Start Date] in your Query, place a Text Field on your Report Menu with a "Start Date" label. The user can then type in the Start Date in the field and then choose to print the report. In your Query, instead of [Enter the Start Date] as the Criteria, use [Forms].[frmMenu].[StartDateParameter], then in the report itself you can add a text box with the same for it's control source (=[Forms].[frmMenu].[StartDateParameter]).

    (Change Form and Field Names as appropriate)

    This way the user doesn't need to type in the same date over and over if they're requesting multiple reports, and you can show the parameters in the report itself.

    If you're not printing the report from a Report menu (i.e. you're just double-clicking the report from the Database Window) this obviously won't work.

    Just something to think about.
    Joel Dixon
    Analyst Programmer
    Melbourne, Australia

  3. #3
    Join Date
    Sep 2003
    Location
    Spokane, WA
    Posts
    81
    Quote Originally Posted by joeldixon66
    How are the user's choosing which report to view? If they are running reports from a Form (I.e. Report Menu), there may be a better way than parameters to limit your report.

    Instead of just putting [Enter the Start Date] in your Query, place a Text Field on your Report Menu with a "Start Date" label. The user can then type in the Start Date in the field and then choose to print the report. In your Query, instead of [Enter the Start Date] as the Criteria, use [Forms].[frmMenu].[StartDateParameter], then in the report itself you can add a text box with the same for it's control source (=[Forms].[frmMenu].[StartDateParameter]).

    (Change Form and Field Names as appropriate)

    This way the user doesn't need to type in the same date over and over if they're requesting multiple reports, and you can show the parameters in the report itself.

    If you're not printing the report from a Report menu (i.e. you're just double-clicking the report from the Database Window) this obviously won't work.

    Just something to think about.
    Well, the user chooses what report to run from a switchboard. And 99.9% of the time it is a single report so the parameters really keep it easy and makes the user think (just a little).

    But what I am trying to accomplish is that when they do run the report looking for "criteria" I would like what ever criteria they use to show up in the header.

    The header would look like:
    ----------
    <label>User Report:</label> <query criteria>Smith</query criteria>

  4. #4
    Join Date
    Sep 2003
    Location
    Spokane, WA
    Posts
    81

    Talking Got It!

    ="This report includes all records for the name " & [Enter LastName] in a text box
    Last edited by jacque427; 05-18-04 at 00:59. Reason: Forgot Something

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •