Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 493
  • Last Modified:

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

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
USArmy1
Asked:
USArmy1
  • 4
  • 2
  • 2
1 Solution
 
Jeffrey CoachmanCommented:
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
 
USArmy1Author Commented:
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
 
Jeffrey CoachmanCommented:
<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
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
Nick67Commented:
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
 
USArmy1Author Commented:
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
 
USArmy1Author Commented:
It works! Thanks!
0
 
USArmy1Author Commented:
Thanks for the help and headache relief!
0
 
Nick67Commented:
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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

  • 4
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now