>Hi, I have a form/subform setup as data entry, the subform is partially
>populated based on drop down combo on the main form. I want to send the data
[quoted text clipped - 3 lines]
>
>Thanks, Bret
Sure. Open the Report from the click event of a button on the form; and use
the WhereCondition parameter of the OpenForm method to pass the ID of the
desired record.
DoCmd.OpenReport "YourReportName", WhereCondition := "[Keyfield] = " & Me!Key
using the actual fieldname of the key field in place of Keyfield and the name
of a control on the form containing that value in place of Key.

Signature
John W. Vinson [MVP]
Bretona10 - 31 Mar 2008 17:24 GMT
Hi John, would this code send all the records in the current subform to the
report?
> >Hi, I have a form/subform setup as data entry, the subform is partially
> >populated based on drop down combo on the main form. I want to send the data
[quoted text clipped - 12 lines]
> using the actual fieldname of the key field in place of Keyfield and the name
> of a control on the form containing that value in place of Key.
John W. Vinson - 31 Mar 2008 18:15 GMT
>Hi John, would this code send all the records in the current subform to the
>report?
No. You're making a very common mistaken assumption here!
The subform DOESN'T contain ANY records.
The report doesn't get any records from the subform.
The subform *is a window*, a tool to display data from a Table.
The report is also a tool that displayes data from a Table.
What you're passing to the report is a query criterion to tell the report
*which* records it should pull from the table. That query criterion is, in
this case, the same criterion that the form uses to specify which records
should be displayed on the subform - so that is the net effect (you see on the
report the same records you see on the subform), but it's important to
understand HOW that happens.

Signature
John W. Vinson [MVP]