how to loop thru records in each page of a report?

how to loop thru records in each page of a report?

Post by Dana » Wed, 09 Feb 2005 12:46:38


Hi,

I like to loop through all the records in a report (that has many pages) and
for each record calculate a value and display it. How can I loop through
the recoreds? What is the collection?
Thanks.
 
 
 

how to loop thru records in each page of a report?

Post by RHVhbmUgSG » Wed, 09 Feb 2005 13:49:03

The report does loop through every record in the report's record source. You
can bind a text box to a calculation based on the other fields in the record.

Perhaps you need to provide more specific information if this doesn't help.

Duane Hookom
MS Access MVP

 
 
 

how to loop thru records in each page of a report?

Post by Dana » Wed, 09 Feb 2005 14:20:21

Hi Dunae,

What I like to do is to is the following:
For every record I like to show a picture based on the value of the ID
field.

fname = "D:\Images\" & CStr(ID) & ".bmp" ' ID is a number field.
[Img].Picture = fname ' Img is an Image contorl on the report.

On what EventProcedure should i place this?
If there were only a record per page i would be done but that's not
the case.
Thanks again

Dana




You
record.
help.

and
 
 
 

how to loop thru records in each page of a report?

Post by RHVhbmUgSG » Wed, 09 Feb 2005 22:45:03

Assuming you have an image control in the detail section, you can set the
picture property of the image control in the On Print or On Format event of
the detail section.

Duane Hookom
MS Access MVP
 
 
 

how to loop thru records in each page of a report?

Post by Dana » Wed, 09 Feb 2005 23:20:11

Hi Duane,

The problem is each record requires a picture. So I need it on the page
one for every record. If I put it in the details section I get one per page.
I need one per record.

Thanks.



of



source.

pages)
through
 
 
 

how to loop thru records in each page of a report?

Post by RHVhbmUgSG » Thu, 10 Feb 2005 01:01:05

Each records create an instance of the detail section. Do you have more
records than images?

Tony Toews has some good resources regarding images in Access at
http://www.yqcomputer.com/
 
 
 

how to loop thru records in each page of a report?

Post by Dana » Thu, 10 Feb 2005 02:21:49

ach report page contains 6 records. Each record has 1 picture. The On
Format handler gets called once per page not 6 times. When its called
I update the image using the first record on that page. The other 5 records
end up with the same picture as the first records. So inside On Format
I need to loop thru all the records on that page.

"Duane Hookom" < XXXX@XXXXX.COM > wrote in message
news: XXXX@XXXXX.COM ...