Command button to print a report

K

Kathleen

I'm trying to put a command button on a form that will
print a single record from a report. I want to restrict
the records that are printed in the report. At the moment
the full report is printing.
 
M

Mike Painter

Kathleen said:
I'm trying to put a command button on a form that will
print a single record from a report. I want to restrict
the records that are printed in the report. At the moment
the full report is printing.
Base the report on a query.
In the criteria for the key field in that query place
Forms!YourFormName!YourKeyFieldName

The report will only print for that record.
 
G

Guest

Mike, thank you. Unfortunately it's not working for me.

I've based the report on a query and used the following
criteria on the PK field.

Forms!frmEmployee!EmployeeID

I get a request to enter a parameter value.
 
C

Con Giacomini

An easy way to do what you want is to add a command button on the form. In
the button's on-click event create a macro to open your report. In the
macro's Where condition enter the following expression
[Client ID]=Forms![OpenFormName]![Client ID]

Of course the field (Client ID] should be replaced by whatever is the
primary key on the form.

Con Giacomini
 

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