Solved

MS Access Subreport doesn't show

Posted on 2009-05-08
6
337 Views
Last Modified: 2013-11-28
Hi,

I have an report in access that has numerous subreports in. The first time I run it (with new data) the report works fine.

If I then close the report and run it again all the data from the subreports goes blank.

I checked the individual subreports on their own and the data is there but it just doesn't appear on the main report, any ideas why?

I've attached an excel sheet with some screen shots and explanations if this helps.

Thanks.

Report-prob.xls
0
Comment
Question by:Ritesh_Mistry
[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
  • 2
  • 2
  • 2
6 Comments
 
LVL 84
ID: 24334598
Are you absolutely, 100% certain that the Data for the MAIN report is consistent in these various views? That is, are you SURE that when you open the Report the FIRST time, then open it the SECOND time, that your report is using the same dataset? If your report is bound, and your report doesn't depend on a Form or Query parameters, then this likely isn't your trouble.

If not, then you may have some corruption. First, make a backup, then Decompile your database: Build a shortcut with this as the Target:

"full path to msaccess.exe" "full path to your database" /decompile

Then run that shortcut. Now open the db again, click Tools - Database Utilities - Compact and Repair. Now open the VBA editor (Ctrl + G), click Debug - Compile. Fix any errors you have, then C&R again. Finally, build a new, blank database and import everything into that new database. Compile again, fix any errors again, and see what happens.
0
 

Author Comment

by:Ritesh_Mistry
ID: 24334696
If I close the database and re-open it the report works fine first time round. It doesn't re-import any data from any external sources or anything like that.

The dataset never changes as I'm running the report off tables that are currently not updated (i've imported them rather than linking).

I have a macro that runs when the report is closed that opens a form but I can't see why this would effect the report as the form isn't linked to any tables etc.

The Main report does have a record source, but i use it to just give me the current date, week, and year.....I'll try to remove this and see what happens. I'll try the decompile you suggested if this fails.
0
 
LVL 84
ID: 24334884
How does the RecordSource update work? Is this code that's running in the Report, perhaps in the Open event, or is this driven from a query (that is, you've got a query that the report is based on, and your query gets the current date and such)?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Ritesh_Mistry
ID: 24335727
It's based on a query just like you say. The query returns date, week, and year and then the main report just displays it.

I tried removing the recordSource as it's not really required but it had no effect.
0
 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 500 total points
ID: 24339034
Ritesh_Mistry,

K.I.S.S
(K)eep (I)t (S)hort and (S)imple

If you create this with just *ONE* sub report, does this still happen?
What I mean is that if you test this with one subreport, and it works, then add one subreport at a time until it fails.
Why add 12 subreports all at once, and try to troubleshoot a massive 12 subreport system?

On the other hand, if it fails with one subreport, then don't add any more reports.
Fix the current report.
It will be a lot easier to troubleshoot one Main Report and one Sub Report that it will be to troubleshoot a Main Report with "numerous" Sub-reports.
Make sense?
;-)

As you can see, the first question is:
Did this report ever work?

Keep us posted

JeffCoachman
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 34051847
;-)
0

Featured Post

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
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 …
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

732 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