Solved

MS Access Subreport doesn't show

Posted on 2009-05-08
6
330 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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
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 …

747 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

12 Experts available now in Live!

Get 1:1 Help Now