Calculating controls on reports

  • Thread starter Thread starter john
  • Start date Start date
J

john

In the 'On Open' event of a report, I would like to loop
through the records in a query for a report. I'm used to
doing this in forms using,

me.recordsetclone.movefirst (example)

Is there a similar way to do this in a report?

I want to loop through the records so that I can make some
calculations and fill in some textboxes on the report.

Thank you

John
 
Hi John,

I would think that you could just work directly with a
recordset based on the query that the report is based
on. Such as,

Dim Db as Database
Dim rst as recordset

Set Db = CurrentDb
Set rst = Db.OpenRecordset("YourQueryName")
With rst etc....

I would think that you should be able to work with the
recordset as in any other module, and the same way that
you work with the form's recordsetclone. But, I haven't
tried this for a report so I'm not positive.

Hope that helps.

-Ted
 
Back
Top