Solved

Help with Access subreport...I can't get data to show up on subreport

Posted on 2011-09-22
8
437 Views
Last Modified: 2013-11-28
I am trying to use a subreport based on a solution given to me by aikimark in a related question. (I couldn't use capricorn1's solution directly as given because my database is split).

I have spent nearly two days trying to get this subreport to display properly. I am re-creating this form:
http://www.ngbpdc.ngb.army.mil/forms/adobe/ngb4100_1_r_e.pdf
Items 14-23 are to contain the subreport data. If you open the subreport in print preview, you will see how I want it to look when placed in "section II" of the main report details section. The reports should be linked by sidstrSSN_SM.

What am I missing?

*All personally identifiable information in attached database has been deleted or scrambled.
4100Report.mdb
0
Comment
Question by:USArmy1
  • 4
  • 2
  • 2
8 Comments
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 36582852
If I am understanding your issue here...

You need to have sidstrSSN_SM in the main Report (in the recordsource).

sidstrSSN_SM appears to be the FK (Foriegn key) in the subreport.
So, in order for the main report to display the corresponding records in the subreport, they must have this field in common.
Then when you insert the subreport into the main report, the subform's Master and Child Linking fields must be set to this field.


JeffCoachman
0
 
LVL 1

Author Comment

by:USArmy1
ID: 36582880
sidstrSSN_SM is in the recordsource for the main report. From reading various tutorials on the internet, it was my understanding that it didn't actually need to be in the report, just in the report's data recordsource.

However, I have tried dozens of ways to get this to work properly, to include putting the sidstrSSN_SM field in the main report, and still could not get the result I am looking for.
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 36583159
<sidstrSSN_SM is in the recordsource for the main report. >
OK

<From reading various tutorials on the internet, it was my understanding that it didn't actually need to be in the report, just in the report's data recordsource.>
Correct

When I insert the subreport into the main report, it does display the corresponding records.

So, again if I am understanding you here correctly, the issue here seems to be a Design/Display issue.
Your main report is designed in such a way as to not allow any room for the subreport to actually display it's data.

So when you say:
"I have spent nearly two days trying to get this subreport to display properly."
...and:
 "I have tried dozens of ways to get this to work properly"
...and:
"could not get the result I am looking for"

You will have to post a clear exact graphic of the "exact" output you are looking for, based on the sample data.

JeffCoachman

0
 
LVL 26

Accepted Solution

by:
Nick67 earned 500 total points
ID: 36584412
After much rebuilding, reworking and hacking, I think I've got your report working.
Your initial report went BANG! every time I tried to add your subreport to it.
Your ABCDEFG query left my head aching.
I eliminated the aliases, and kept the table names.

The subreport just didn't function.
When you are using a correlated subreport DON'T mess with grouping or paging.
Your old one just wouldn't display at all.

Have a look and see if the data looks right, as I messed majorly with that
Army.mdb
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 1

Author Comment

by:USArmy1
ID: 36586644
Nick67,

Thanks for that! That looks exactly like what I was trying to do! The data seems to be displaying correctly now. Any ideas what in particular was the cause? Before I close out the question and award points, I'm going to see if I can replicate your work in my actual database.

Thanks a lot!
0
 
LVL 1

Author Comment

by:USArmy1
ID: 36586807
It works! Thanks!
0
 
LVL 1

Author Closing Comment

by:USArmy1
ID: 36586812
Thanks for the help and headache relief!
0
 
LVL 26

Expert Comment

by:Nick67
ID: 36587700
There was one bit in that query that I may not have gotten right.  It involved an NZ with tables e and g.
I am not sure why you had aliased all those tables.
With a subreport, because it will be embedded in a section and correlated to the main report, you don't generally do things like grouping and page breaks.
Something in your original subreport--and I am not sure what--just made it never show anything.
So I built a new one.  It wasn't brutally complex :)

I know, having many in-laws in the Canadian Armed Forces, that acronym soup is SOP.
Those acronyms that come from the military and make sense to anybody looking at them, keep.
I would consider being a bit more verbose with any field names you created.

Always design from the viewpoint that somebody else may have to maintain your work someday.
Glad you got it working!
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now