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

  • Thread starter Thread starter Dana
  • Start date Start date
D

Dana

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.
 
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
 
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.
.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
 
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

Dana said:
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.
.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


[QUOTE="Duane Hookom"]
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
[/QUOTE]
[/QUOTE]
 
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.

Duane Hookom said:
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

Dana said:
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.
.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


[QUOTE="Duane Hookom"]
The report does loop through every record in the report's record[/QUOTE] source.
You[QUOTE]
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

:

Hi,

I like to loop through all the records in a report (that has many[/QUOTE] pages)
and[QUOTE]
for each record calculate a value and display it. How can I loop through
the recoreds? What is the collection?
Thanks.
[/QUOTE]
[/QUOTE][/QUOTE]
 
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.granite.ab.ca/access/imagehandling.htm.

Dana said:
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.

Duane Hookom said:
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

Dana said:
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.
.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


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

:

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.
[/QUOTE][/QUOTE]
[/QUOTE]
 
Each 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 said:
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.granite.ab.ca/access/imagehandling.htm.

Dana said:
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.

Duane Hookom said:
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

:

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.
.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


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

:

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.
[/QUOTE]
[/QUOTE][/QUOTE]
 
Thanks Duane
My handler was in the header section by mistake.
Thanks so much for taking the time to explain the solution.
:)



Duane Hookom said:
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.granite.ab.ca/access/imagehandling.htm.

Dana said:
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.

Duane Hookom said:
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

:

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.
.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


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

:

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.
[/QUOTE]
[/QUOTE][/QUOTE]
 
Back
Top