Show number of pages prior to printing

  • Thread starter Thread starter Gina Whipp
  • Start date Start date
G

Gina Whipp

Hello All,

This is probably an easy one but I can't figure it out...

I would like an MsgBox to display indicating how many copies of a form to
insert. You can only print 3 records per page (that part I got already!)
But now if there are 5 records, I want it to say "Please insert to forms",
once you have done so, press okay and it prints...

Hope I explained that ok...
Thanks in advance,
Gina
 
Hi Gina,

In the 'open' event of the report, write some code to
open a recordset that your report is based on and do a
rst.recordcount and apply your criteria to that something
like

if rst.recordcount > 3 then
pagestoinsert = Round((rst.recordcount)+0.5 / 3)
end if

msgbox "Please insert " & pagestoinsert & " pages to
print your document.", vbokonly, "Printer attention
required"


Hope this works out for you!
 
Will give it a try thanks..

PSIAccess said:
Hi Gina,

In the 'open' event of the report, write some code to
open a recordset that your report is based on and do a
rst.recordcount and apply your criteria to that something
like

if rst.recordcount > 3 then
pagestoinsert = Round((rst.recordcount)+0.5 / 3)
end if

msgbox "Please insert " & pagestoinsert & " pages to
print your document.", vbokonly, "Printer attention
required"


Hope this works out for you!
 
Okay, I'm having trouble getting it to work... still working on it... I
get a message Object Variable not set... Posted the code in case it
helps...

Dim rst As Recordset
Dim PagesToInsert As Integer

If rst.RecordCount > 3 Then
PagesToInsert = Round((rst.RecordCount) + 0.5 / 3)
End If

MsgBox "Please insert" & PagesToInsert & "pages to print your form.",
vbOKOnly, "Printer Attention Required"
 
Back
Top