Print from a form to a report

Toledo123

Registered User.
Local time
Today, 03:22
Joined
Sep 21, 2012
Messages
12
I have a PO Form. After the user enters the information on the form I want to have a button that when clicked can send the information to the report where it can either be previewed or printed. Can someone tell me exactly how to do that?

My report is called POReport
My form is called frmPurchaseOrder
My Primary Key is NewPurchaseOrderID

Thanks for any help you can give me
 
In the criteria of the query populating your report put the following;
Code:
Forms!frmPurchaseOrder!NewPurchaseOrderID

This will create a report specific to the current record on form frmPurchaseOrder.
 
Thank you for that

Don't I have to put some kind of button on my form?
 
Yes you will need a button;
Code:
DoCmd.[URL="http://msdn.microsoft.com/en-us/library/office/bb238032%28v=office.12%29.aspx"]OpenReport[/URL] "YourReportName", acNormal
Will simply print the report for the current record if you use the schema I described in my previous post.

If you do not want to use the method described in my previous post try;
Code:
DoCmd.OpenReport "YourReportName", acNormal, "NewPurchaseOrderID = " & Me.NewPurchaseOrderID
Using this method there will be no need to adjust your existing query.
 
Thank you for that, it worked just great. Is there a way to send that filed to print preview and not directly to the printer?
 

Users who are viewing this thread

Back
Top Bottom