can number of pages be reset?

  • Thread starter Thread starter Some Girl
  • Start date Start date
S

Some Girl

I have my page numbers reset by the group using a macro
where the [Page] is set to one. This works well.

What I would like to do in addition, is have the Number Of
Pages reset with each group as well as the page number(eg.
one group is 4 pages = 1 of 4, 2 of 4...., next group is 3
pages = 1 of 3, 2 of 3....).

Can this be done? and if so...How would I do it?

I'm a novice and using Access 97, please keep that in mind
when answering.
 
I have my page numbers reset by the group using a macro
where the [Page] is set to one. This works well.

What I would like to do in addition, is have the Number Of
Pages reset with each group as well as the page number(eg.
one group is 4 pages = 1 of 4, 2 of 4...., next group is 3
pages = 1 of 3, 2 of 3....).

Can this be done? and if so...How would I do it?

I'm a novice and using Access 97, please keep that in mind
when answering.
See the reports section at http://www.mvps.org/access
 
I followed that link, and that sounds exactly
like what I would like.

But when I open the report, the area where the number
should show up is blank.

I followed the instructions and changed the Me!Salesperson
to the control I wanted it to follow and added a textbox
at the bottom named ctlGrpPages for the Me!ctlGrpPages
line.

Does Access 97 support this?

Another thing that I tried and kind of liked, but had a
small
problem with was this.

I created a form with a button to control how the report
was
printed (I found this trick online) with an On Click Event
like this:

Private Sub btnPrintInsp_Click()
On Error GoTo Err_Command4_Click
Dim db As Database
Dim rs As Recordset
Dim FilterCriteria As String

Set db = CurrentDb
Set rs = db.OpenRecordset("select distinct Inspections
from Query3")

rs.MoveFirst
Do Until rs.EOF
FilterCriteria = "[Inspections] = '" & rs!Inspections
& "'"
DoCmd.OpenReport "Bell 212 Schduled Inspection Guide",
acNormal, , FilterCriteria
rs.MoveNext
Loop

Exit_Command4_Click:
Exit Sub

Err_Command4_Click:
MsgBox Err.Description
Resume Exit_Command4_Click
End Sub

I also have the macro set to reset the "Page" for each
group.

This also works great, but I ran into a problem when I
thought
I could open the form along with the report to make
getting the
job done easier.

The problem I ran into here, was that all the wonderful
work
that I put into the button seemed to have no effect when
it was
opened with the report as a dialog. Yet, it works on its
own
when the report wasn't open.

The events I have set to open the form with the report are
as
follows:

Private Sub Report_Close()
DoCmd.Close acForm, "frmPrintReport", acSaveNo
End Sub

Private Sub Report_Open(Cancel As Integer)
DoCmd.OpenForm "frmPrintReport"
End Sub

Basically, as long as the report is NOT open, it will
print
the way I want.


I hope I'm not too open/lenthy with the info here, but I
really want to know if one or the other can be done the
way
I would like, and feel that the more info I have here will
help
others see what I'm doing wrong (if not confusing them).

I would like to be able to print while the form is open,
even if
not from the form itself.

Is there a problem with one or both of these codes? Can
what I
want BE done? Am I doing something really silly?
 
I followed that link, and that sounds exactly
like what I would like.

But when I open the report, the area where the number
should show up is blank.

I followed the instructions and changed the Me!Salesperson
to the control I wanted it to follow and added a textbox
at the bottom named ctlGrpPages for the Me!ctlGrpPages
line.

Does Access 97 support this?

The report should work just fine in Access 97.
From the instructions:
"When Access formats a report, it often times must make two passes
through the report for information such as Page 1 of 10; since Access
cannot know how many pages the report will contain until the entire
report is formatted."

Did you remember to add a control to the report to compute [Pages]?
=[Pages]
or
= [Page] & " of " [Pages]
You can make this control not visible if you wish.
 
Back
Top