Pictures in reports - THIRD TRY! ANYONE??

  • Thread starter Thread starter RB
  • Start date Start date
R

RB

I ran a search in this newsgroup and found this question
asked twice without an answer, so hopefully the third time
is the charm!

I have a database in which I store a picture of each tool
we carry. The picture is stored in a text field in the
table called [Photo] and this field contains the path to
the file for that record. I want to print a report with
the information for each tool, and I want the
corresponding picture to each tool to print next to that
tool's information. The Access help file says to program
the code using the On Current event, but my version
(Access XP) does not have an On Current event for reports.
I can't seem to find anything else that works, and the
help file is basically useless (thanks Microsoft). I would
appreciate any help I can get on how to print these photos!

Thanks,
RB
 
I have a database in which I store a picture of each tool
we carry. The picture is stored in a text field in the
table called [Photo] and this field contains the path to
the file for that record. I want to print a report with
the information for each tool, and I want the
corresponding picture to each tool to print next to that
tool's information. The Access help file says to program
the code using the On Current event, but my version
(Access XP) does not have an On Current event for reports.
I can't seem to find anything else that works, and the
help file is basically useless (thanks Microsoft). I would
appreciate any help I can get on how to print these photos!

To display the picture in a *form*, it's the "On Current" event, but in a
*report*, it's the "On Print" event for the section containing the image control
that you are looking for.
 
I have a database in which I store a picture of each tool
we carry. The picture is stored in a text field in the
table called [Photo] and this field contains the path to
the file for that record. I want to print a report with
the information for each tool, and I want the
corresponding picture to each tool to print next to that
tool's information.

The sample imaging databases at http://accdevel.tripod.com illustrate three
approaches to handling images in Access, and the download includes an
article discussing considerations in choosing an approach. Two of the
approaches do not use OLE Objects and, thus, avoid the database bloat
associated with images in OLE Objects.

In Reports, use the OnPrint event rather than the OnCurrent event used in
Forms. If you are printing the images in reports, to avoid memory leakage,
you should also see MVP Stephen Lebans'
http://www.lebans.com/printfailures.htm

PrintFailure.zip is an Access97 MDB containing a report that fails during
the Access formatting process prior to being spooled to the Printer Driver.
This MDB also contains code showing how to convert the contents of the Image
control to a Bitmap file prior to printing. This helps alleviate the "Out of
Memory" error that can popup when printing image intensive reports.

Larry Linson
Microsoft Access MVP
 
Thanks! This worked. I appreciate your help.

RB

-----Original Message-----
I have a database in which I store a picture of each tool
we carry. The picture is stored in a text field in the
table called [Photo] and this field contains the path to
the file for that record. I want to print a report with
the information for each tool, and I want the
corresponding picture to each tool to print next to that
tool's information. The Access help file says to program
the code using the On Current event, but my version
(Access XP) does not have an On Current event for reports.
I can't seem to find anything else that works, and the
help file is basically useless (thanks Microsoft). I would
appreciate any help I can get on how to print these
photos!

To display the picture in a *form*, it's the "On Current" event, but in a
*report*, it's the "On Print" event for the section containing the image control
that you are looking for.

--
Bruce M. Thompson, Microsoft Access MVP
(e-mail address removed) (See the Access FAQ at http://www.mvps.org/access)within the newsgroups so that all might benefit.<<


.
 
The only way I have found to print photos or view them in a form, is t
import them into a OLE feild as a bitmap or TIF, it does not work wit
jpg's, with A2000 anyway. I have found a database example of jp
viewing at www.lebans.com, but only for forms, maybe it can b
modified.
 
The only way I have found to print photos or view them in a form, is to
import them into a OLE feild as a bitmap or TIF, it does not work with
jpg's, with A2000 anyway. I have found a database example of jpg
viewing at www.lebans.com, but only for forms, maybe it can be
modified.
 
The only way I have found to print photos or view them in a form, is to
import them into a OLE feild as a bitmap or TIF, it does not work with
jpg's, with A2000 anyway.

You need to install the relevant graphics filters from within Office setup in
order to view JPG files.
 
Could Bruce or someone else give step by step instructions
on how to get to 'On Print'/Image Control and accomplish
this? We have a database that has linked pictures that we
need printed in a report, but no one can figure out how to
get there. Any help appreciated.
-----Original Message-----
Thanks! This worked. I appreciate your help.

RB

-----Original Message-----
I have a database in which I store a picture of each tool
we carry. The picture is stored in a text field in the
table called [Photo] and this field contains the path to
the file for that record. I want to print a report with
the information for each tool, and I want the
corresponding picture to each tool to print next to that
tool's information. The Access help file says to program
the code using the On Current event, but my version
(Access XP) does not have an On Current event for reports.
I can't seem to find anything else that works, and the
help file is basically useless (thanks Microsoft). I would
appreciate any help I can get on how to print these
photos!

To display the picture in a *form*, it's the "On
Current"
event, but in a
*report*, it's the "On Print" event for the section containing the image control
that you are looking for.

--
Bruce M. Thompson, Microsoft Access MVP
(e-mail address removed) (See the Access FAQ at http://www.mvps.org/access)
within the newsgroups so that all might benefit.<<


.
.
 
I hope this isn't a duplicate post, I can't see the first
one. Can anyone help with step by step instructions to
get to the Image Control in On Print? We have a db with
items and hyperlinked jpegs that we want to print with the
report, but we don't know how to accomplish this, any help
appreciated.
-----Original Message-----
Thanks! This worked. I appreciate your help.

RB

-----Original Message-----
I have a database in which I store a picture of each tool
we carry. The picture is stored in a text field in the
table called [Photo] and this field contains the path to
the file for that record. I want to print a report with
the information for each tool, and I want the
corresponding picture to each tool to print next to that
tool's information. The Access help file says to program
the code using the On Current event, but my version
(Access XP) does not have an On Current event for reports.
I can't seem to find anything else that works, and the
help file is basically useless (thanks Microsoft). I would
appreciate any help I can get on how to print these
photos!

To display the picture in a *form*, it's the "On
Current"
event, but in a
*report*, it's the "On Print" event for the section containing the image control
that you are looking for.

--
Bruce M. Thompson, Microsoft Access MVP
(e-mail address removed) (See the Access FAQ at http://www.mvps.org/access)
within the newsgroups so that all might benefit.<<


.
.
 
I hope this isn't a duplicate post, I can't see the first
one. Can anyone help with step by step instructions to
get to the Image Control in On Print? We have a db with
items and hyperlinked jpegs that we want to print with the
report, but we don't know how to accomplish this, any help
appreciated.
-----Original Message-----
Thanks! This worked. I appreciate your help.

RB

-----Original Message-----
I have a database in which I store a picture of each tool
we carry. The picture is stored in a text field in the
table called [Photo] and this field contains the path to
the file for that record. I want to print a report with
the information for each tool, and I want the
corresponding picture to each tool to print next to that
tool's information. The Access help file says to program
the code using the On Current event, but my version
(Access XP) does not have an On Current event for reports.
I can't seem to find anything else that works, and the
help file is basically useless (thanks Microsoft). I would
appreciate any help I can get on how to print these
photos!

To display the picture in a *form*, it's the "On
Current"
event, but in a
*report*, it's the "On Print" event for the section containing the image control
that you are looking for.

--
Bruce M. Thompson, Microsoft Access MVP
(e-mail address removed) (See the Access FAQ at http://www.mvps.org/access)
within the newsgroups so that all might benefit.<<


.
.
 
I hope this isn't a duplicate post, I can't see the first
one. Can anyone help with step by step instructions to
get to the Image Control in On Print? We have a db with
items and hyperlinked jpegs that we want to print with the
report, but we don't know how to accomplish this, any help
appreciated.
-----Original Message-----
Thanks! This worked. I appreciate your help.

RB

-----Original Message-----
I have a database in which I store a picture of each tool
we carry. The picture is stored in a text field in the
table called [Photo] and this field contains the path to
the file for that record. I want to print a report with
the information for each tool, and I want the
corresponding picture to each tool to print next to that
tool's information. The Access help file says to program
the code using the On Current event, but my version
(Access XP) does not have an On Current event for reports.
I can't seem to find anything else that works, and the
help file is basically useless (thanks Microsoft). I would
appreciate any help I can get on how to print these
photos!

To display the picture in a *form*, it's the "On
Current"
event, but in a
*report*, it's the "On Print" event for the section containing the image control
that you are looking for.

--
Bruce M. Thompson, Microsoft Access MVP
(e-mail address removed) (See the Access FAQ at http://www.mvps.org/access)
within the newsgroups so that all might benefit.<<


.
.

-----Original Message-----
I have a database in which I store a picture of each tool
we carry. The picture is stored in a text field in the
table called [Photo] and this field contains the path to
the file for that record. I want to print a report with
the information for each tool, and I want the
corresponding picture to each tool to print next to that
tool's information.

The sample imaging databases at
http://accdevel.tripod.com illustrate three
 
Can someone please post step by step instructions on how
to get to On Print and how to change the imaging so that
linked jpgs can be printed with a report? We are not
experts, obviously, we haven't done this before. We have
a large database with linked jpegs that need to be printed
with the report. Any help appreciated.
-----Original Message-----
Thanks! This worked. I appreciate your help.

RB

-----Original Message-----
I have a database in which I store a picture of each tool
we carry. The picture is stored in a text field in the
table called [Photo] and this field contains the path to
the file for that record. I want to print a report with
the information for each tool, and I want the
corresponding picture to each tool to print next to that
tool's information. The Access help file says to program
the code using the On Current event, but my version
(Access XP) does not have an On Current event for reports.
I can't seem to find anything else that works, and the
help file is basically useless (thanks Microsoft). I would
appreciate any help I can get on how to print these
photos!

To display the picture in a *form*, it's the "On
Current"
event, but in a
*report*, it's the "On Print" event for the section containing the image control
that you are looking for.

--
Bruce M. Thompson, Microsoft Access MVP
(e-mail address removed) (See the Access FAQ at http://www.mvps.org/access)
within the newsgroups so that all might benefit.<<


.
.
 
I hope this isn't a duplicate post, I can't see the first
one. Can anyone help with step by step instructions to
get to the Image Control in On Print? We have a db with
items and hyperlinked jpegs that we want to print with the
report, but we don't know how to accomplish this, any help
appreciated.

I would suggest that this solution be delegated to someone who is moderately
familiar with VBA as it is entirely dependent on code. It would appear, from
your post, that you don't have anyone in-house who has written code in Access.
To provide an explanation, step by step, that would walk a non-programmer
through this would take longer to put together than I can muster time for. For
that, I apologize. Of course, it's possible that someone else can and will make
an attempt.

:-)
 
I would suggest that this solution be delegated to someone who is moderately
familiar with VBA as it is entirely dependent on code. It would appear, from
your post, that you don't have anyone in-house who has written code in Access.
To provide an explanation, step by step, that would walk a non-programmer
through this would take longer to put together than I can muster time for. For
that, I apologize. Of course, it's possible that someone else can and will make
an attempt.
Not a problem, I had hoped it was going to be a relatively
simple modification to the output of the report, but
you're right, no one here writes VBA. I guess the plan
has changed by now anyway, instead of sending a hard copy
we'll be sending the electronic version - which was, by
the way MY suggestion in the first place!!! Thanks anyway!
 
Here is an example of the code I use.

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
On Error GoTo ErrHandler
Me.imgSample.Picture = Me.txtSample
Exit Sub
ErrHandler:
Me.imgSample.Picture = Application.CurrentProject.Path &
"\Photos\00.jpg"
Exit Sub
End Sub

I have an image control called imgSample. I also have a text box called
txtSample that contains the name of the file and the path, something like
"c:\Photos\sample01.jpg". By setting the .Picture property of the image
control it changes the picture that is shown. By having this code in the
OnPrint event causes the code to run each time the detail section is
printed, thereby updating each picture for each record. The problem is that
if you try to assign a picture that does not exist an error gets generated.
The lower part of the code runs when that error occurs. The code chnages
the image from the one that caused the error to the file 00.jpg which is a
generic picture I've created and know exists.

Good luck.
 
Back
Top