Print one record

K

Kathy R.

I have a form with a subform. Classic one to many
relationship. The company information is at the top of
the form, and the monthly orders for that company are
displayed in the subform. One monthly order is displayed.
Move to the other monthly orders by using the record
navigation buttons at the bottom of the subform.

I created a command button which successfully runs a
report from the form. The query for the report takes the
company record that is displayed in the form and ships it
to the report. In the Company field in the query -
[Forms]![frmMainDataEntyForm]![Company]. This works.

How do I tell the query to only select the record
displayed in the subform for that company? I am currently
getting all the subform records for the company printed on
the report.

I have tried putting the following in the report query, in
the OrderDate field, but it doesn't work - [Forms]!
[frmOrderSubForm]![OrderDate]
 
F

Fons Ponsioen

Hi Kathy.
If you wish to print only the current company and only the
one currently displayed record in you subform you can do
this exactly like you did with your main form and report,
[Company] = [Forms]![frmMainDataEntyForm]![Company] and
Month = [Forms]![YourSubForm]![SelectedMonth]
I am not sure where you set this selection but it could
easily be done in the underlying query for your report.
Hope this helps.
Fons
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top