• Status: Solved
  • Priority: Low
  • Security: Public
  • Views: 54
  • Last Modified:

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?
0
Jennie Parmer
Asked:
Jennie Parmer
  • 3
3 Solutions
 
Ryan ChongCommented:
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
 
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 ChongCommented:
do you need further assistance here?
0
 
Ryan ChongCommented:
as suggested
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now