Solved

MS Access Subreport doesn't show

Posted on 2009-05-08
6
331 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
  • 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
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.

 

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

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

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

912 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now