Results 1 to 5 of 5
  1. #1
    newbie is offline Advanced Beginner
    Windows XP Access 97
    Join Date
    May 2009
    Posts
    34

    Use Parameter Criteria in a Report HELP!


    I currently have a drop down box where I select a client name, this filters a parameter report which asks the end user to enter a start date and end date and then in turn creates a report for a specific client and date range. On my report I have two unbound text boxes where I have set the control source to the parameter query [start date] and [end date]. This works great....when there is data returned between the date range entered. However, when no data is returned I lose my client name field as well as the two parameter criterial fields. How do I retain these pieces if info so that when the report opens the text box I have set to be visible when no data returned will read "No results found for ClientX for the date range of start date - end date"?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,970
    I almost never use dynamic parameterized queries. I never set queries with popup input prompts. I use forms for user input of filter criteria. Then I use VBA code to construct filter criteria and apply to form or report when opened. Query can reference controls on form for criteria parameters. Textboxes on form or report can reference the criteria input controls on form.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    newbie is offline Advanced Beginner
    Windows XP Access 97
    Join Date
    May 2009
    Posts
    34
    Yes, I have seen some blogs and post about using forms. That seems very complicated and may be a little out of my expertise! I thought I was doing good just to make my drop down box filter my query. I will start down that path I guess. If anyone else has any other suggestions a little more beginner friendly I would love to hear them!

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,970
    I really don't think there is another way to go. Dynamic parameters in query will filter records but as you found out, if no records meet the criteria then there is no data for the report to display, not even the parameters.

    Referencing controls on form not that much more difficult. Although, Access 97 might not have as friendly an interface to aid in building the references.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    newbie is offline Advanced Beginner
    Windows XP Access 97
    Join Date
    May 2009
    Posts
    34
    It took a lot of persistence and trial and error but I am happy to report that I was able to accomplish the task of using a form to capture my parameters and can successfully use the parameters in my report EVEN when no results are returned in the underlying query. The link below was a huge help! I hope others struggling with this issue find it useful.

    http://office.microsoft.com/en-us/ac...005187411.aspx

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 09-10-2013, 07:34 PM
  2. Replies: 1
    Last Post: 12-04-2012, 02:50 PM
  3. Parameter with Month & Year Criteria
    By Huddle in forum Access
    Replies: 3
    Last Post: 10-24-2012, 01:20 PM
  4. Replies: 3
    Last Post: 08-15-2011, 10:06 AM
  5. Criteria Parameter
    By djwasim in forum Reports
    Replies: 1
    Last Post: 07-04-2009, 08:22 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums