Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...This is easily the most helpful website I've ever used, and this is the best forum with the quickest response time bar none...."

Geography

Where in the world do Tek-Tips members come from?

Pulling data from subreport's detail area to report's detail area

hedgracer (Programmer)
17 Jun 12 19:58
I have a subreport detail area that has the following detail:

Box SumOfYTDConverted
5700 1200.00
5720 1699.00
5740 2000.00

The subreport is named Sec_Combined_Test.

In my main report I have a the subreport named Sec_Combined_Test. It is small and not visible. I am trying to do the following in a particular textbox of the main report:

=IIf([Sec_Combined_Test].[Report]![Box]="5700",[Sec_Combined_Test].[Report]![SumOfYTDConverted],0)

This always results in 0. If I just do =[Sec_Combined_Test].[Report]![Box] I get 5740 in the textbox. How can I get the SumOfYTDConverted number for 5700 in this textbox from the subreport? Any help is greatly appreciated.

Dave
dhookom (Programmer)
17 Jun 12 22:04
Are there more than one text box in the detail section of the subreport? If so, I'm not sure how you can reference any other than maybe the last one. You can't "query" these.

You could probably have a report footer of the subreport to calculate the value and then reference the single instance of the value from the main report.

Duane
Hook'D on Access
MS Access MVP

hedgracer (Programmer)
18 Jun 12 10:10
Are there more than one text box in the detail section of the subreport? If so, I'm not sure how you can reference any other than maybe the last one. You can't "query" these.

There is not more than one text box in the detail section of the subreport. Box and SumOfYTDConverted are completed by reading rows from a table named Sec_Combined_Test. That is the reason I figured I could do the if statement.

You could probably have a report footer of the subreport to calculate the value and then reference the single instance of the value from the main report.

This was my second option. Do a report footer (or page footer) for each box and then reference that in the if statement. I do not know if that is possible.

Dave
dhookom (Programmer)
18 Jun 12 14:22
I meant to ask if there are multiple records in the subreport. If this is the case, I expect you need to use a Report or Group footer section (no page footer). Your control source in the Report Footer section might be something like:

CODE --> ControlSource

=Sum(Abs([Box]="5700") * [SumOfYTDConverted])
This assume the Box field is a text value rather than numeric.

Duane
Hook'D on Access
MS Access MVP

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close