View Full Version : How to select row to use on report


Gkirkup
03-27-2009, 11:07 AM
I have a form on which a subform shows line detail on a sale. As you select each line (detail record), several subforms show information relating to that item. That works fine.
Now I have to transfer that situation to the report. I need to select each record in turn from the subform, and print the related information subforms. Then move onto the next record, etc.
Any suggestions on how I would do that? I am not sure how I would progress through the detail line-by-line records on a report.

Robert

PaulO
03-31-2009, 05:41 AM
So, your display subforms are working fine ...

I think all you need to do is build a query based on the same data but limiting the query output to one record based on the key data field in the form (this will be the same field that is driving the subform displays)

Thereafter, link a new report to the query and place a print/preview button on the same form.

Gkirkup
03-31-2009, 06:50 AM
Paul: Yes, I am heading in that direction. BTW, I like your tag line. I am an Access 'expert' to some people, but a complete novice as soon as I get to this site!

Robert

PaulO
03-31-2009, 06:59 AM
Yup you're on the money there Robert!

I've learnt a lot from using this forum and in return I try to make the odd response to others by way of payback!

:)

boblarson
03-31-2009, 08:08 AM
Actually, because there is a WHERE clause that you can pass to a report in the code to open it, you can have a generic report with a generic query and just by passing the right parameters you can have a report that is dynamic based on what you pass to it.

Check out this sample here:
http://downloads.btabdevelopment.com/Samples/reports/Sample-GenericReport.zip

And there are more samples here:
http://www.btabdevelopment.com/main/AccessSamples/tabid/54/Default.aspx