Is it possoble to add a picture daynamically to a report?

  • Thread starter Thread starter dee
  • Start date Start date
D

dee

Hi,
I would like to have an Image control on my report and have VBA place
a picture dynamcially based on some criteria. When I tried to add code to
On Open Event Prodcure VB gives me error.
I appreciate any help.
(The picture i'm showiing is not in the data base, only its name is)

Thanks.
Dee
 
Dee,

Place an image control onto your report where you want the
image to appear. Set it's properties such as zoom /
stretch / etc. You will probably have to point the picture
property at an image (the wizard will require it) - just
point it at any picture as this property will be altered
later.

Add the field which contains the path to the report
section that contains the image - set the visible property
to "No". Even though this is in your record source, for
some reason it needs to be on the report (?).

In the section's (detail section, group header section or
wherever) "On Format" event set the image's "picture"
property.
Something like:

dim picky as string
picky = [myPickyPathField]
[imagename].picture = picky

I believe this can also be set in the "on Print" event
also although I have always done it in the on format event.

A few notes:
If possible use bitmaps as they perform much better in
Access than other formats.
Stephen Lebans has some good stuff for converting to
bitmaps on the fly - www.lebans.com
I run into oddball problems after about 5000 pages with
bitmap images so if you are expecting to print very large
reports consider breaking them into smaller 2-3000 page
lumps.


HTH,

Terry
 
Terry,

Works beautifully.
Thanks so much for taking the time to explain write it down.
I'm only gonna be printing about a 100 reports. I never worked
with reports before. Can you use record fields in a report the way
you can with a form? I tired to change the value of one of the bound
fields but VB said that the expression didn't evaluate to anything.
Thanks again.
Dee


Terry said:
Dee,

Place an image control onto your report where you want the
image to appear. Set it's properties such as zoom /
stretch / etc. You will probably have to point the picture
property at an image (the wizard will require it) - just
point it at any picture as this property will be altered
later.

Add the field which contains the path to the report
section that contains the image - set the visible property
to "No". Even though this is in your record source, for
some reason it needs to be on the report (?).

In the section's (detail section, group header section or
wherever) "On Format" event set the image's "picture"
property.
Something like:

dim picky as string
picky = [myPickyPathField]
[imagename].picture = picky

I believe this can also be set in the "on Print" event
also although I have always done it in the on format event.

A few notes:
If possible use bitmaps as they perform much better in
Access than other formats.
Stephen Lebans has some good stuff for converting to
bitmaps on the fly - www.lebans.com
I run into oddball problems after about 5000 pages with
bitmap images so if you are expecting to print very large
reports consider breaking them into smaller 2-3000 page
lumps.


HTH,

Terry



-----Original Message-----
Hi,
I would like to have an Image control on my report and have VBA place
a picture dynamcially based on some criteria. When I tried to add code to
On Open Event Prodcure VB gives me error.
I appreciate any help.
(The picture i'm showiing is not in the data base, only its name is)

Thanks.
Dee



.
 
Dee,

I am unsure what you are asking for here. Forms and
reports can be treated pretty much the same. The main
difference is that reports use the grouping/sorting and
NOT the query to order the data.

Fields from the record source can be dragged onto a report
in the same way as you would on a form. With whatever it
is that "doesn't evaluate" can you provide more detail?

HTH

Terry
-----Original Message-----
Terry,

Works beautifully.
Thanks so much for taking the time to explain write it down.
I'm only gonna be printing about a 100 reports. I never worked
with reports before. Can you use record fields in a report the way
you can with a form? I tired to change the value of one of the bound
fields but VB said that the expression didn't evaluate to anything.
Thanks again.
Dee


Dee,

Place an image control onto your report where you want the
image to appear. Set it's properties such as zoom /
stretch / etc. You will probably have to point the picture
property at an image (the wizard will require it) - just
point it at any picture as this property will be altered
later.

Add the field which contains the path to the report
section that contains the image - set the visible property
to "No". Even though this is in your record source, for
some reason it needs to be on the report (?).

In the section's (detail section, group header section or
wherever) "On Format" event set the image's "picture"
property.
Something like:

dim picky as string
picky = [myPickyPathField]
[imagename].picture = picky

I believe this can also be set in the "on Print" event
also although I have always done it in the on format event.

A few notes:
If possible use bitmaps as they perform much better in
Access than other formats.
Stephen Lebans has some good stuff for converting to
bitmaps on the fly - www.lebans.com
I run into oddball problems after about 5000 pages with
bitmap images so if you are expecting to print very large
reports consider breaking them into smaller 2-3000 page
lumps.


HTH,

Terry



-----Original Message-----
Hi,
I would like to have an Image control on my report and have VBA place
a picture dynamcially based on some criteria. When I tried to add code to
On Open Event Prodcure VB gives me error.
I appreciate any help.
(The picture i'm showiing is not in the data base, only its name is)

Thanks.
Dee



.


.
 
Hi Terry,

My problem is I have more than one record in each page of the report
and the following chooses the first records picture for all other field's
pictures on that page.

dim picky as string
picky = [myPickyPathField]
[imagename].picture = picky

Thanks
Dee

Terry said:
Dee,

I am unsure what you are asking for here. Forms and
reports can be treated pretty much the same. The main
difference is that reports use the grouping/sorting and
NOT the query to order the data.

Fields from the record source can be dragged onto a report
in the same way as you would on a form. With whatever it
is that "doesn't evaluate" can you provide more detail?

HTH

Terry
-----Original Message-----
Terry,

Works beautifully.
Thanks so much for taking the time to explain write it down.
I'm only gonna be printing about a 100 reports. I never worked
with reports before. Can you use record fields in a report the way
you can with a form? I tired to change the value of one of the bound
fields but VB said that the expression didn't evaluate to anything.
Thanks again.
Dee


Dee,

Place an image control onto your report where you want the
image to appear. Set it's properties such as zoom /
stretch / etc. You will probably have to point the picture
property at an image (the wizard will require it) - just
point it at any picture as this property will be altered
later.

Add the field which contains the path to the report
section that contains the image - set the visible property
to "No". Even though this is in your record source, for
some reason it needs to be on the report (?).

In the section's (detail section, group header section or
wherever) "On Format" event set the image's "picture"
property.
Something like:

dim picky as string
picky = [myPickyPathField]
[imagename].picture = picky

I believe this can also be set in the "on Print" event
also although I have always done it in the on format event.

A few notes:
If possible use bitmaps as they perform much better in
Access than other formats.
Stephen Lebans has some good stuff for converting to
bitmaps on the fly - www.lebans.com
I run into oddball problems after about 5000 pages with
bitmap images so if you are expecting to print very large
reports consider breaking them into smaller 2-3000 page
lumps.


HTH,

Terry




-----Original Message-----
Hi,
I would like to have an Image control on my report and
have VBA place
a picture dynamcially based on some criteria. When I
tried to add code to
On Open Event Prodcure VB gives me error.
I appreciate any help.
(The picture i'm showiing is not in the data base, only
its name is)

Thanks.
Dee



.


.
 
It works now.
Thanks Terry sooooooo much.:)

Terry said:
Dee,

I am unsure what you are asking for here. Forms and
reports can be treated pretty much the same. The main
difference is that reports use the grouping/sorting and
NOT the query to order the data.

Fields from the record source can be dragged onto a report
in the same way as you would on a form. With whatever it
is that "doesn't evaluate" can you provide more detail?

HTH

Terry
-----Original Message-----
Terry,

Works beautifully.
Thanks so much for taking the time to explain write it down.
I'm only gonna be printing about a 100 reports. I never worked
with reports before. Can you use record fields in a report the way
you can with a form? I tired to change the value of one of the bound
fields but VB said that the expression didn't evaluate to anything.
Thanks again.
Dee


Dee,

Place an image control onto your report where you want the
image to appear. Set it's properties such as zoom /
stretch / etc. You will probably have to point the picture
property at an image (the wizard will require it) - just
point it at any picture as this property will be altered
later.

Add the field which contains the path to the report
section that contains the image - set the visible property
to "No". Even though this is in your record source, for
some reason it needs to be on the report (?).

In the section's (detail section, group header section or
wherever) "On Format" event set the image's "picture"
property.
Something like:

dim picky as string
picky = [myPickyPathField]
[imagename].picture = picky

I believe this can also be set in the "on Print" event
also although I have always done it in the on format event.

A few notes:
If possible use bitmaps as they perform much better in
Access than other formats.
Stephen Lebans has some good stuff for converting to
bitmaps on the fly - www.lebans.com
I run into oddball problems after about 5000 pages with
bitmap images so if you are expecting to print very large
reports consider breaking them into smaller 2-3000 page
lumps.


HTH,

Terry




-----Original Message-----
Hi,
I would like to have an Image control on my report and
have VBA place
a picture dynamcially based on some criteria. When I
tried to add code to
On Open Event Prodcure VB gives me error.
I appreciate any help.
(The picture i'm showiing is not in the data base, only
its name is)

Thanks.
Dee



.


.
 
Back
Top