Print Recordset - loop question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to print 1 report for each record in a recordset. That set is based on
a query and the report on a different recordset - related by an ID.

I can't seem to get the code working on my form (based on the query) to
print the first record (ID) then move to the next, and so on, 'til it reaches
the end.

I can get it to print the first record - but the Link Criteria in the print
routine sez "=Me.ID"...which is the current record on the form, I need to
reference the next and so on...

Me.RecordsetClone
Do
....Print "Report"; Link = "Me.ID"...
Loop Until Me.RecordsetClone.EOF

Help, thanks in advance, N.
 
Ned said:
I need to print 1 report for each record in a recordset. That set is
based on a query and the report on a different recordset - related by
an ID.

I can't seem to get the code working on my form (based on the query)
to print the first record (ID) then move to the next, and so on, 'til
it reaches the end.

I can get it to print the first record - but the Link Criteria in the
print routine sez "=Me.ID"...which is the current record on the form,
I need to reference the next and so on...

Me.RecordsetClone
Do
...Print "Report"; Link = "Me.ID"...
Loop Until Me.RecordsetClone.EOF

Help, thanks in advance, N.

If that is not pseudocode above it is completely wrong.

Usually a report is simply designed and run. There should be no need for any
code to print a report for each record in a recordset.
The query that relates them is all that is needed.
 
Thanks, Mike. Here's the deal:

I have 9 new orders that need invoices. I have a query/form that tells me
which 9 orders are new and need invoices. I need 1 invoice for each new
order.

Without a form that contains each new order and a button that launches the
print job (click order, push/print, click next, push print, ect...) I don't
how to get them all out to th printer.

I want to say, "For each new order, print and invoice"...

Thanks again, Ned
 
Ned said:
Thanks, Mike. Here's the deal:

I have 9 new orders that need invoices. I have a query/form that
tells me which 9 orders are new and need invoices. I need 1 invoice
for each new order.

Without a form that contains each new order and a button that
launches the print job (click order, push/print, click next, push
print, ect...) I don't how to get them all out to th printer.

I want to say, "For each new order, print and invoice"...

Thanks again, Ned

The invoice would have, if properly designed an Invoice header table and an
invoice line item table.

A query relating those two tables would be used to build a report that
printed those invoices.
It would include whatever query tells you what is new.

If the tables are properly designed NO code is needed exceept on the button
that prints the report and a wizard does that.
Even if not properly designed it should be just a matter of building a
report.
 
Back
Top