Results 1 to 5 of 5
  1. #1
    aellistechsupport is offline Competent Performer
    Windows 7 32bit Access 2003
    Join Date
    Apr 2014
    Posts
    410

    Conditional value from subreport to main report?

    There are several fields on the subreport I want on the main report.

    I'm able to put the value from the subreport to the main report EXCEPT when I'm trying to add a condition.

    Code:
    =IIf(([InStateTaxSummary subreport].[Report]![SalesTaxGroup])="City",[InStateTaxSummary subreport].[Report]![SalesTaxAmount],0)
    It's producing $0 when it should be $283.76.


    When I do a simple query to verify the IIF statement it works, but not in the main report.
    What am I doing wrong?

    SalesTaxGroup SalesTaxAmount
    City $283.76
    County $139.55
    RTA $113.54
    State $329.14

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    Do you actually mean when [SalesTaxGroup]=" the word "CITY" (as in your sample)

    or do you mean then the city in [SalesTaxGroup]= the city name in FIELD: [CITY]

    ??

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    You're trying to refer to a specific row in the subreport, which will be unpredictable. You're probably getting the last row (test for "State" and see). You could put a textbox in the footer that sums only city, and refer to that.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    But why do the decision in the report, it should be made in the query.

  5. #5
    aellistechsupport is offline Competent Performer
    Windows 7 32bit Access 2003
    Join Date
    Apr 2014
    Posts
    410
    Ok, so I have a summary tax report in which each of the taxes shown is placed in a different part of the main report.

    So I want to place the value for the SalesTaxGroup = "City" on a certain place of the main report.

    The State on another part of the main report and so on.

    Paul is correct in that it is displaying the last one, the State value of $329.14 when I place the SalesTaxGroup field.
    Why I'm trying to say when it equals one of them to be placed on a certain location on the main report until all of the four are placed displaying the correct value from the subreport.

    If there is an easier way to do this, please share. Thank you!


    Oh, on that note.
    Here's the full query:
    Tax % SalesTaxGroup SalesTaxAmount CountyTaxable
    2.5% City $283.76 $11,345.54
    1.23% County $139.55 $11,345.54
    1% RTA $113.54 $11,345.54
    2.9% State $329.14 $11,345.54


    I'll also need to place the above formatted like this and having issues since a cross-tab query subreport isn't working right either.
    County
    1.23%
    RTA
    1.00%
    State
    2.90%
    $11,345.00
    $139.55
    $11,345.00
    $113.54
    $11,345.00
    $329.14

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

Similar Threads

  1. Replies: 1
    Last Post: 04-15-2013, 10:02 AM
  2. Subreport with criteria from main report
    By Evilferret in forum Reports
    Replies: 1
    Last Post: 08-15-2012, 03:19 PM
  3. Replies: 1
    Last Post: 06-22-2012, 06:55 AM
  4. Replies: 3
    Last Post: 06-15-2012, 11:14 AM
  5. Combine Main Report with subreport
    By jortizz in forum Reports
    Replies: 2
    Last Post: 05-05-2011, 12:42 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