Print individual pages in a report

K

kjstec

Hi - I created a custom report to look like a current form we use in our
department. When I run the report, it shows all 1500 records. Is there
anyway to print individual pages in a report? I am new to Access. We input
many Serious Adverse Events for the Oncology Research department - if I need
to get a specific SAE to the IRB - can I fill in the form a single page
report so that I only have to print the one page of the report?

Thanks,
Kathy
 
D

Dirk Goldgar

kjstec said:
Hi - I created a custom report to look like a current form we use in our
department. When I run the report, it shows all 1500 records. Is there
anyway to print individual pages in a report? I am new to Access. We
input
many Serious Adverse Events for the Oncology Research department - if I
need
to get a specific SAE to the IRB - can I fill in the form a single page
report so that I only have to print the one page of the report?


If you have a button on the form to "Print This Event" (for example), you
can specify the ID (or primary key) of that event as a criterion in the code
behind the button that prints the report. For example:

Private Sub cmdPrintThis_Click()

If IsNull(Me.EventID) Then\
MsgBox "Can't print -- No Current Event"
Exit Sub
End If

' Make sure the current record has been saved.
If Me.Dirty Then Me.Dirty = False

' Print the report. Could preview it instead, if you wanted to.
DoCmd.OpenReport "rptSAEReport", _
WhereCondition:="EventID = " & Me.EventID

End Sub

That code assumes that "EventID" is the name of the primary key field for
the table that is behind both the form and the report.
 
K

Ken Sheridan

Kathy:

If I might add one small point to Dirk's reply. It assumes that EventID is
a number data type, e.g. an autonumber. If it, or whatever your equivalent
key field is called, should happen to be text data type, then you'd need to
wrap its value in quotes characters like so:

WhereCondition:="EventID = """ & Me.EventID & """"

A pair of contiguous quotes characters within a string expression is
interpreted as a literal quotes character.

Ken Sheridan
Stafford, England
 

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