Solved

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

Posted on 2011-09-22
8
481 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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

615 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