Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how can i print only pages with certain information

Status
Not open for further replies.

mike2150

Technical User
Aug 20, 2004
2
AU
Hi all,

Just wondering if there was a way i can get access to print only the single page of a report where a field is equal to a certain value.

The scenario is i am designing a DBMS for a friend who is starting up his own travel agency. Data is input through pretty average forms, but he wants the ability to print the "invoice" report from the form itself...

now before you all start telling me it is simple, i know it is, but he wants it to only pront the invoice that is aplicable to that particular customer from a report several hundres pages long. Is sthere some way to reference this agains the customer number of a client to make access only print the page where thjat customer number appears?

Any thoughts you have would eb greatly appreciated

Mike
 
Mike
I am assuming, from your post, that each record has a RecordID or CustomerID field. You need to reference that in the Where clause of the DoCmd code.

Behind the command button that Prints, or Previews, your report, put code such as...

Code:
DoCmd.OpenReport "YourReportName", acViewPreview,, "[CustomerID] = Forms!YourInvoiceFormName!CustomerID"

Or if there are a number of invoices for that customer, you may want to reference the Invoice#. If so, then your code would be like...
Code:
DoCmd.OpenReport "YourReportName", acViewPreview,, "[InvoiceID] = Forms!YourInvoiceFormName!InvoiceID"

Change the names, play with these, and you will get the result you want.

Tom


 
Tom,

Thanks greatly for your help, it now works perfectly and i will be able to finish the final build this afternoon.

Cheers

Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top