Print one page of a report

D

Dan

I have a report that has one page for each record and we
print the report all at once through a print button on a
form. However, I also need to also be able to print the
individual page that responds to the current record. Is
there any way to do this.
 
A

Allen Browne

Use the WhereCondition of the OpenReport action to limit the report to just
the current record.

This example assumes the form is bound to a table that has an AutoNumber
named ID:

Private Sub cmdPrintThisRecord_Click()
If Me.Dirty Then 'Save first.
Me.Dirty = False
End If
If Me.NewRecord Then
Msgbox "Select a record to print."
Else
DoCmd.OpenReport "MyReport", acViewPreview, , "ID = " & Me.[ID]
End If
End Sub
 
K

Katrina

If you only want to print for the current record, put a where clause(without
the word where) on your openreport action.

Docmd.openreport "rptName", acviewpreview, ,"CustomerID = " & me.customerID


HTH
Kat
 
H

hcj

Hi Dan,
Make a Command Button that uses Record Operations/Print
Record. If you use Form Operations, it will print all
records - not what you want.

Hope this helps.
 

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