Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2008
    Posts
    25

    Unanswered: Report asking for parameters twice

    Good day

    I have a report which is fired from a button, calls a macro, which calls a query. The query has a condition asks the user for parameters. They are fromDate and toDate. The conditional part of the query is:

    ........WHERE (((TBL_Support_Call.DateTime)>=[Enter From Date] And (TBL_Support_Call.DateTime)<=[Enter To Date]))
    ORDER BY TBL_Support_Call.[DateTime] DESC;

    This all works fine however when I File > export.....to Excel I get asked for the parameters again. This is very annoying how can I stop this?

    TYIA

  2. #2
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Don't use query parameters. They're ugly as hell anyway.

    Use a reporting dialog box to let your user pick the dates they want, then you won't ever get asked for parameters.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  3. #3
    Join Date
    Dec 2008
    Posts
    25
    Cool thankyou for your time I will look into what you suggest

  4. #4
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    No problem.

    Just create yourself a form that has the criteria you want (both dates, maybe more), have an OK button on it to call up your report. Then your queries can refer to Forms![YouDialogBoxFormName]![YourFromDateControlName] for example, instead of [Enter From Date]

    The other fantastic thing about doing this is that even the developer (you) won't have to worry about entering dates all the time just to see the layout of the report.

    Another one is that many reports can use the same dialog box.
    Attached Thumbnails Attached Thumbnails sshot.jpg  
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

Posting Permissions

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