Solved

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

Posted on 2011-09-22
8
458 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
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 
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
 
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

776 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