How do I get a single page report for a current form record?

I have an invoice form that makes a report for mailing.  However, everytime I run the  report, all records are visible. How do I limit to the current form?
Jennie ParmerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
all records are visible. How do I limit to the current form?

you need to filter your report by passing the condition.

Apply a Filter When Opening a Form or Report
https://msdn.microsoft.com/en-us/vba/access-vba/articles/apply-a-filter-when-opening-a-form-or-report

DoCmd.OpenReport Method (Access)
https://msdn.microsoft.com/en-us/vba/access-vba/articles/docmd-openreport-method-access
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Robert WardlowPresidentCommented:
Hello Jennie,

Ryan is exactly right but you can also try this:

You can base your invoice report on a query and you can specify in the query a field to select the customer you want to send your invoice to.

I will assume there is a field in your query something like customerID
I also assume there is a field on your invoice form for customerID

In the query for your report add this to the customerID field:
forms![invoice form name].customerID

This will select the customerID from the form as the record selected for the report as long as the form is open.

Hope this helps
Bob
0
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
How are you printing the Invoice? If you're just printing the Form, then you'd instead need to setup a Report, as the other Experts have suggested. Printing a Form will print every record in the current datasource for that form.

IMO, a better method to print from a form is to create a report that contains all of the records you need, then supply the WHERE argument of the OpenReport method:

DoCmd.OpenReport "NameOfYourReport", acViewPreview, , "InvoiceID=" & Me.InvoiceID
0
Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
do you need further assistance here?
0
Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
as suggested
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.