Solved

MS Access Subreport doesn't show

Posted on 2009-05-08
6
332 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
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

813 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

14 Experts available now in Live!

Get 1:1 Help Now