Report_Open event in a subreport

  • Thread starter Thread starter Carl Rapson
  • Start date Start date
C

Carl Rapson

I have a report that contains 10 columns of data for each row. I don't
always need 10 columns, however, so in the Report_Open event I am hiding
some of the columns. I also shorten some lines by the width of the hidden
columns. When I run this report by itself everything works as I expect it
to. When I embed this as a subreport in another report, however, I encounter
a problem. When I do a Print Preview of the report/subreport, everything
looks OK on screen. But if I then print the report from the Preview mode, it
looks like the lines in the subreport are being shortened a second time.
This only seems to happen when I print from Print Preview mode -- if I send
the report straight to the printer (no preview), it doesn't happen. I've
tried trapping the Report_Open event of the subreport, but it only seems to
be firing once. Any ideas as to why my lines would be adjusted a second time
only when printing the report/subreport from Print Preview mode? Do I maybe
need to adjust my controls in an event other than Report_Open?

Thanks for any assistance,

Carl Rapson
 
Carl said:
I have a report that contains 10 columns of data for each row. I don't
always need 10 columns, however, so in the Report_Open event I am hiding
some of the columns. I also shorten some lines by the width of the hidden
columns. When I run this report by itself everything works as I expect it
to. When I embed this as a subreport in another report, however, I encounter
a problem. When I do a Print Preview of the report/subreport, everything
looks OK on screen. But if I then print the report from the Preview mode, it
looks like the lines in the subreport are being shortened a second time.
This only seems to happen when I print from Print Preview mode -- if I send
the report straight to the printer (no preview), it doesn't happen. I've
tried trapping the Report_Open event of the subreport, but it only seems to
be firing once. Any ideas as to why my lines would be adjusted a second time
only when printing the report/subreport from Print Preview mode? Do I maybe
need to adjust my controls in an event other than Report_Open?


That might happen even in preview mode, depending on what's
going on in the report.

The trick is to check if the controls have already been
moved so you don't move them more than once.
 
Thanks, Marshall. I'll look at using some kind of flag to indicate that.
Reports always give me fits.

Carl Rapson
 
Maybe you can use the report's Open event to save the
controls' Left property in module level variables ot the
controls' Tag proerty. Then only move controls whose Left
property matched the saved value.
 
That's an interesting idea, I keep forgetting about the Tag property. Thanks
again.

Carl Rapson

Marshall Barton said:
Maybe you can use the report's Open event to save the
controls' Left property in module level variables ot the
controls' Tag proerty. Then only move controls whose Left
property matched the saved value.
--
Marsh
MVP [MS Access]


Carl said:
Thanks, Marshall. I'll look at using some kind of flag to indicate that.
Reports always give me fits.

Carl Rapson
 
Back
Top