pass parameter from form to rpt upon click

  • Thread starter Thread starter anna
  • Start date Start date
A

anna

I have a cust form that has a sales-order subform. If the
use clicks the sales-order-id from the subform, I'd like
to display a sales-order-detail report (line items) for
that sales order. How do I pass the sales-order-id that
the user clicked on to the report?
 
Try this:

Open the query for the report. In the criteria row of the
sales-order-id field type:
[Forms]![Main Form Name].[SubForm Name]![sales-order-id]

Create an event procedure for the "ON Click" event of the
sales-order-id field on the subform that will open the
report:
DoCmd.OpenReport "Your Report Name", acViewPreview.

acViewPreview will open in Print Preview
acViewNormal will print
 
Back
Top