Print Selected Records

T

TheCaptain

Hello,

I am using a form that shows the results of a query. I would like to print
only selected records using a check box. So, for example: If I run my query
and get 10 results I can check the box yes for 4 records and then hit print
(or a print button) and only print the four. Any ideas?

Thanks
 
S

Steve

Add a field called "Selected" (Yes/No data type) to your table. Add nthat
field to your query and form. You can now check the records you want to
print. Create a new query to be the recordsource of your report. Base the
new query on your existing query. In the new query, set the criteria for the
Selected field to True. After you print, be sure to update the Selected
field to False.

Steve
 
T

TheCaptain

It works thanks.

Steve said:
Add a field called "Selected" (Yes/No data type) to your table. Add nthat
field to your query and form. You can now check the records you want to
print. Create a new query to be the recordsource of your report. Base the
new query on your existing query. In the new query, set the criteria for the
Selected field to True. After you print, be sure to update the Selected
field to False.

Steve
 
W

Wayne-I-M

Hi

The less "stuff" you have in a DB the better it is IMO. You don't really
need another query - you just need to filter the report OnPrint

Follow Steve's good advice and create a yes no field in the table. Add this
to your form (so you can click it or not) to select which record you want
included in the report.
Add it to the report details as well (set to Visible = No)

On your form add a button and have this as the OnClick event

Private Sub ButtonName_Click()
DoCmd.OpenReport "ReportName", acViewPreview, "", "[YesNoField]=-1", acNormal
End Sub

Change ButtonName, ReportName,YesNoField to the names you have used in your
application

Hope this helps
 
T

TheCaptain

That's better. Thanks

Wayne-I-M said:
Hi

The less "stuff" you have in a DB the better it is IMO. You don't really
need another query - you just need to filter the report OnPrint

Follow Steve's good advice and create a yes no field in the table. Add this
to your form (so you can click it or not) to select which record you want
included in the report.
Add it to the report details as well (set to Visible = No)

On your form add a button and have this as the OnClick event

Private Sub ButtonName_Click()
DoCmd.OpenReport "ReportName", acViewPreview, "", "[YesNoField]=-1", acNormal
End Sub

Change ButtonName, ReportName,YesNoField to the names you have used in your
application

Hope this helps


--
Wayne
Manchester, England.



TheCaptain said:
It works thanks.
 

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