0
votes

I have some troubles with my database. I am trying to create a subreport within a main report, I tried this with two different ways. the result is the same in both ways.

Way #1 - In the main report, clicked Subform/Subreport icon and selected the subreport from the list which has been prepared prior.

Way #2 - In the main report, clicked Subform/Subreport icon then built the subreport form the corresponding query, so that the fields I want appeared in the Child fram within the main report.

*****In both ways, at the run time the database gets panic, and Access shutdown my application database.*****

Note: Either main report or subreport is workig individually in good condition viewing the data based on the filter criteria.

2

2 Answers

1
votes

Review your "Link Master Fields" and "Link Child Fields" on the sub form. You could be creating a Cartesian Product. Sometimes, a query on the sub report is just too complex and can cause Access to crash (I've only noticed that in previous versions.).

0
votes

Forms can get corrupt. Sometimes you can just copy everything out of the old form into a new form and it will work, sometimes you need to save as text, delete the form, and load from text.

Application.SaveAsText acForm, "form1", "z:\docs\tmp.txt"
Application.LoadFromText acForm, "form1rest", "z:\docs\tmp.txt"

Report

Application.SaveAsText acReport, "report1", "z:\docs\tmp.txt"
Application.LoadFromText acReport, "rep1rest", "z:\docs\tmp.txt"

If you have been developing for some time on the same database, you should backup, compact & repair, decompile and even copy to a fresh database. There are other notes on recovering from corruption here: http://www.granite.ab.ca/access/corruptmdbs.htm

Also consider your printer drivers and make sure that simple reports work.