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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open a report with related field from form

Status
Not open for further replies.

ehsguy77

IS-IT--Management
Feb 12, 2004
93
US
I'm trying to preview a report from an order form. Both the form and report are built upon the same query. I had hoped that the command button wizard would let me choose a relationship (ie, open report and find specific data to display), but it did not.

Do I need to add criteria in the query from the report design properties that link the report to the order ID# on the form? If so, how? Or do I need to add code to the onclick event to open the report. I've posted the vba that I have.

Private Sub Command93_Click()
On Error GoTo Err_Command93_Click


DoCmd.PrintOut

Exit_Command93_Click:
Exit Sub

Err_Command93_Click:
MsgBox Err.Description
Resume Exit_Command93_Click

End Sub
 
Hi,
From inside the form, you can use "filter" to pass the criteria to the report. See my FAQ on the topic: [faq703-2657]

HTH, [pc2]
Randy Smith, MCP
rsmith@cta.org
California Teachers Association
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top