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?