Report crash on closing if height change

Kowalski

Registered User.
Local time
Tomorrow, 01:06
Joined
Jul 5, 2007
Messages
121
Hi
Funny problem in Access 2010.
I have a report (in Print Preview). It's got nothing on except 2 subreports in the Details section.
If I change the Height of the subreport in the section's OnFormat event, it works fine, but Access crash when you close the report.
Simething like:
Me.MySubReport.Height = SomeHeight

Changing the height in the OnOpen works fine, but not an option for me.
Any ideas?
 
I could be wrong but I don't think you can modify the size of a control (and that is what your subreport is) at time of printing. Which probably also apply at print preview or format.

Perhaps it would help to explain why you can't use the Can Shrink/Can Grow functions found the Reports Property window...
 
Thanks for replying.
First the reason: Based on the type on the parent report, users can customise which subsections they would like to see on the first page of the 'certificate'. They can choose 1 or more out of a selection of about 8. Based on the number of subsections, we show/hide the subreports, and resize them to fill the available space on the page. Should fit in 1 page. The Can Grow/Can Shrink will cause the report to grow beyond page 1.

If your answer is correct that the controls cannot be sized during printing, I would expect either an error message, or the code not to work. But the code works. It just crashes when you close the report. And the functionality worked 100% in Access 97. :confused:
 
Yeah, we all miss Access 97 which on top of it being *very* stable was also *very* forgiving. Each version after that has become less forgiving. Not all *errors* generate an error message; there are quite a few that either cause Access to crash or simply quietly fail.

I am basing my *theory* on an old thread I seem remember with Master :D Stephen Leban. I seem to remember someone was trying the same sort of thing and the report crashed.

The only advice I can give you is to make those subreports as small as possible and make sure that both the Can Grow and Can Shrink properties is set to yes. I have a report like that and basically I have sliver of a subreport showing that way I don't get pushed to a second page when I know it can all fit on one page.
 
Bummer - but thanks for the reply.
I also noticed today that it only happens in Print Preview mode. The Report view seems to be okay. But gives other issues.
And SP1 also did not work.
Let's hope SP2 will be released within 24 minutes.
 
Well, let's hope I'm wrong and someone passes by to say so... but for now :( not looking so good. Good Luck!
 
I did realise that Access crash when you try to resize the subreports - but only if one control on the subreport contains a control with a solid border. Changing all the borders to transparent actually works.
How strange is that?
 
Heh, now! I did not know about the transparent thing! That is strange... I know what I'll be talking about in MVP Group therapy!
 
Just for other people who might have the same issue - it gets stranger. The problem only occurs if the subreport have items with a solid border of hairline width. Making it 1pt also works. You go Microsoft.
 
I have just stumbled on this thread after a colleague was running out of hair to pull out.

Over ten years later this is still a problem with the latest O365 version. 🤦‍♂️
Very belated thanks for posting the answer.
 

Users who are viewing this thread

Back
Top Bottom