Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2011-09-22
8
Medium Priority
?
486 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 26

Accepted Solution

by:
Nick67 earned 2000 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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
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…

715 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