Printing selected report-pages

  • Thread starter Thread starter Trois Jay
  • Start date Start date
T

Trois Jay

I do have a report with 4 pages. What I want is the user being asked for input, only the selected pages to be printed.
So, if they select only page 1 and 3, only 2 pages should be printed.

At this moment I have all controls given the pagenumber (they are on) in their tag-property; based on the selection they are made
visible of invisble, but the pages with invisible controls are displayed (and printed) as blank pages (though headers and footers
are printed), which is just a waste of paper and time.
Shrinking their heigth to zero doesn't work either, page is blank but printed anyway.

How do I leave out the blank pages, avoiding they being printed? The report contains dozens of controls, so putting them all on top
of report and then use the 'can grow' property would create clutter and chaos, which is not maintainable.

Any suggestions? Thanks in advance!


Regards,

Jacques

3J Consultancy
www.troisj.com
--

PS

Posted this 2 days ago in 'microsoft.public.access.modulesdaovba' but haven't received any reply on it so far. So please don't start
about 'cross posting', I might have posted it in wrong group, which you can hold against me....
 
As far as I know, your only choice is to actually run the report twice.
First time print page 1 (or whatever page). Second time print whatever the
other page number is.
This can be done automatically using the PrintOut method in conjunction with
the SelectObject method.
The following will print out pages 1 and 3 of a multi-page report.

DoCmd.SelectObject acReport,"ReportName",True
DoCmd.PrintOut acPages, 1,1
DoCmd.PrintOut acPages, 3,3

You can use a form control for the user to enter the wanted page. Just make
sure each printout method refers to the correct control:
DoCmd.PrintOut acPages , [ControlName], [ControlName])

See Access Help.

--
Fred

Please reply only to this newsgroup.
I do not reply to personal e-mail.


Trois Jay said:
I do have a report with 4 pages. What I want is the user being asked for
input, only the selected pages to be printed.
So, if they select only page 1 and 3, only 2 pages should be printed.

At this moment I have all controls given the pagenumber (they are on) in
their tag-property; based on the selection they are made
visible of invisble, but the pages with invisible controls are displayed
(and printed) as blank pages (though headers and footers
are printed), which is just a waste of paper and time.
Shrinking their heigth to zero doesn't work either, page is blank but printed anyway.

How do I leave out the blank pages, avoiding they being printed? The
report contains dozens of controls, so putting them all on top
of report and then use the 'can grow' property would create clutter and
chaos, which is not maintainable.
Any suggestions? Thanks in advance!


Regards,

Jacques

3J Consultancy
www.troisj.com
--

PS

Posted this 2 days ago in 'microsoft.public.access.modulesdaovba' but
haven't received any reply on it so far. So please don't start
 
Thanks Fred, exactly what I needed, works fine!
(Never used 'docmd.printout' before: was looking in wrong direction: within the report I thought to be able to select the pages and
print them from there).

Regards,

Jacques J.J. Soudan

3J Consultancy
www.troisj.com


As far as I know, your only choice is to actually run the report twice.
First time print page 1 (or whatever page). Second time print whatever the
other page number is.
This can be done automatically using the PrintOut method in conjunction with
the SelectObject method.
The following will print out pages 1 and 3 of a multi-page report.

DoCmd.SelectObject acReport,"ReportName",True
DoCmd.PrintOut acPages, 1,1
DoCmd.PrintOut acPages, 3,3

You can use a form control for the user to enter the wanted page. Just make
sure each printout method refers to the correct control:
DoCmd.PrintOut acPages , [ControlName], [ControlName])

See Access Help.

--
Fred

Please reply only to this newsgroup.
I do not reply to personal e-mail.


Trois Jay said:
I do have a report with 4 pages. What I want is the user being asked for
input, only the selected pages to be printed.
So, if they select only page 1 and 3, only 2 pages should be printed.

At this moment I have all controls given the pagenumber (they are on) in
their tag-property; based on the selection they are made
visible of invisble, but the pages with invisible controls are displayed
(and printed) as blank pages (though headers and footers
are printed), which is just a waste of paper and time.
Shrinking their heigth to zero doesn't work either, page is blank but printed anyway.

How do I leave out the blank pages, avoiding they being printed? The
report contains dozens of controls, so putting them all on top
of report and then use the 'can grow' property would create clutter and
chaos, which is not maintainable.
Any suggestions? Thanks in advance!


Regards,

Jacques

3J Consultancy
www.troisj.com
--

PS

Posted this 2 days ago in 'microsoft.public.access.modulesdaovba' but
haven't received any reply on it so far. So please don't start
 
Back
Top