Calculating controls on reports

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
 
T

Ted

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
 

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