Printer Issue - tracking lines printed to use to eject the page

J

John B

In the original basic language you could keep track of the number of lines
printed for a page and tell the page to eject when the line number got to or
past a certain number. Is there a way to do that with Access or Visual Basic?
 
J

John Spencer

If you mean you want to start a new page every 25 detail lines in a
report, then this can be done.

Add a new control to the detail section
-- Name it LineCounter
-- Set its control source to
=1
-- Set it to SUM overall
-- Set its visible property to NO

Now add a Page break control to the report at the bottom of the detail
section. Name the control MyBreak

Click on the detail header and enter
[Event procedure] in the On Print event
-- Click on the three dots at the end

-- Enter the following in the sub
Me.MyBreak.Visible = (LineCounter Mod 25 = 0)

-- That should make page break control visible every 25 lines

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================
 
M

Marshall Barton

John said:
In the original basic language you could keep track of the number of lines
printed for a page and tell the page to eject when the line number got to or
past a certain number. Is there a way to do that with Access or Visual Basic?


Lines don't mean much anymore. Since you can place variable
size controls (text boxes, etc) at arbitrary locations in
sections that can grow or shink, there really is no suck
thing as a line on the printer.

You can easily number the detail sections that appear in a
report by using a text box (named txtDtlCnt) with the
expression =1 and RunningSum set to Over Group or Over All.

With a counter like that, you can add a page break control
(named pgNewPage) to the bottom of the detail section and
make it visible when the appropriate number is reached:

Me.pgNewPage.Visible = (txtDtlCnt Mod 12 = 0)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top