Results 1 to 7 of 7
  1. #1
    jcright is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Feb 2022
    Posts
    21

    multiple subreports requesting same criteria


    Hello all,

    I have a main report that holds 4 subreports. Each subreport is based on the same criteria which is a month/year combo.
    When I open this up, it repeatedly asks me for the same criteria. I'm trying to figure out how to enter the criteria once.

    Any thoughts?

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    Quote Originally Posted by jcright View Post
    Hello all,

    I have a main report that holds 4 subreports. Each subreport is based on the same criteria which is a month/year combo.
    When I open this up, it repeatedly asks me for the same criteria. I'm trying to figure out how to enter the criteria once.

    Any thoughts?
    If you are saying that all the sub forms reference a combo box on the main form to restrict the records in the subform, then keep in mind that the subforms actually open before the main form opens. Perhaps set the RecordSource properties of the sub form once the main form has opened.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    jcright is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Feb 2022
    Posts
    21
    Bob. No, it wasn't going to combo boxes. Each subreport had a query that asked for a parameter. Based on that parameter it would filter information for that report. What I finally figured out is that I can do a master/child link of the subreports to the main menu. Then it only asks me for the parameter once.

  4. #4
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    Quote Originally Posted by Bob Fitz View Post
    If you are saying that all the sub forms reference a combo box on the main form to restrict the records in the subform, then keep in mind that the subforms actually open before the main form opens. Perhaps set the RecordSource properties of the sub form once the main form has opened.
    While that is true for subforms, I'm pretty sure that it's not the same for subreports, which is what the OP is using.

    Ideally, you shouldn't be asked to input the value even once. I take it that the field containing the value is not on the main report, or the value isn't making it there.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  5. #5
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    Each subreport is based on the same criteria which is a month/year combo.
    I assumed that your reference here to "combo" meant a combo box.

    I'm glad you found a solution.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  6. #6
    Gicu's Avatar
    Gicu is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,115
    Most developers prefer to use a "reporting" form where you would set the desired criteria in certain controls (textboxes, comboboxes, etc.) instead of prompting for the criteria in each report's record source.

    https://www.oreilly.com/library/view...7/ch01s02.html
    https://docs.microsoft.com/en-us/off...-qbf-technique

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  7. #7
    jcright is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Feb 2022
    Posts
    21
    Yep, I totally get why you would think that. So when I open my report it asks me which month and year I want. Each subreport uses that month/year criteria.

    Unfortuately it doesn't work as well as I originally thought. This is a commission report for salespeople and the pay struture is convoluted. At the moment, I'm just trying to get a report that actually works. For the most part, I've done that...now I need to go back and try to automate certain things, like selecting which month and year to do the report on. Some sales people don't normally sell something in a month and there are overrides involved on deals, etc. So linking the master/child works, but it seems to only work if the person made a sale. If they didn't, then it comes back blank....its kind of like it maybe looks at the first report, sees it is blank and then gives up despite the fact that other subreports have information. I'll have to figure this part out later. Only a couple of people are like this, so it isn't too horrible. What I really need to do is figure out how to make one report that can pull up each salesperson based on the pay period and send a report to them via email. Learning as I'm going.

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

Similar Threads

  1. Filter Criteria for Subreports of A Report
    By dccjr3927 in forum Programming
    Replies: 10
    Last Post: 06-11-2019, 03:00 PM
  2. Replies: 5
    Last Post: 01-27-2016, 03:00 PM
  3. Multiple Subreports
    By aytee111 in forum Reports
    Replies: 2
    Last Post: 10-15-2015, 03:42 PM
  4. Replies: 1
    Last Post: 10-16-2013, 03:44 PM
  5. Multiple Subreports with page break
    By rayc in forum Reports
    Replies: 7
    Last Post: 09-02-2006, 06:59 PM

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