Help Needed ASAP

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

We have the need to attach pictures in .JPG format to a form. We are using
the Insert Object, Link and attaching them, they then appear as Microsoft
photo 3.0...What is happening is the back end file has ballooned to a massive
size, at present 2.9 Gigs. I tried to compact it and get an error message
that says 'invalid argument'. Can anyone help me to understand why the file
has gotten so out of hand and how to stop it.

Thank you,
IEJ
 
ACCESS stores images very poorly... essentially in an uncompressed format
and then some.

Better to store the location of an image file in a table field, and then go
get that file when you want to use it by using the location from the field.
 
Dear Ken, Thank you, may I ask for a bit more information on what you mean.
Do you mean actually typing the location name in i.e.
X:\SurveyDatabase\Pictures\1234.JPG into the Image OLE field?

Thanks,
IEJ
 
No, you would use a text data type field, not an OLE field.

Then, depending upon how you want to display the image, you use programming
to "get" the picture and display it. This can be done by using
FollowHyperlink via a command button, or by setting the picture property of
an unbound image control to that path, or other ways. Would need to know
more about what you're doing to give you more info.
--

Ken Snell
<MS ACCESS MVP>
 
Thank you, I think I may just about be understanding but not quite yet. I
have a form, with at the moment, an OLE frame (we do not necessarily have to
see the picture on that form, we are just using the form to attach the
picture to it). We then have a report that the pictures do show up on that
has to be output to a customer in a PDF format so that they can see the
details on the form above and the picture on the bottom of the form.

I am not sure what you mean about using a command button to access them, but
would be able to explain a bit more about that. Maybe it's the setting the
picture property.....thank you for your help, I'll watch for your response.

Regards,
IEJ
 
In the report, you can put an image control in the Detail section. You'll
need to set it to an image path initially, but we'll use code to modify it
for each record in the report's recordset. Name the Image control
imgPicture.

Also put the field that holds the path to that record's image on the report.
Name it txtImgPath and make the control invisible.

Then, in the Format event of the Detail section for the report, use code
similar to this:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Me.imgPicture.Picture = Me.txtImgPath .Value
End Sub
 
Dear Ken, okay, have put an Image box on, have put an unbound text box named
txtImgPath and make invisible, have put the code in. Now, how do I get a
file path into the unbound txt box txtImgPath. Is it something that you have
to type in? I have 367 pictures and each one is specific to the location.

Thanks, will wait for your return.
IEJ
 
Sorry another question. These items are all on the Report, I still need to
get them added in, presumably at the form level, how do I go about that.

Thanks again,
IEJ
 
txtImgPath must be a bound textbox, and it should be bound to the field that
holds the path to the image.
 
We have the need to attach pictures
in .JPG format to a form. We are using
the Insert Object, Link and attaching
them, they then appear as Microsoft
photo 3.0...What is happening is the
back end file has ballooned to a massive
size, at present 2.9 Gigs. I tried to
compact it and get an error message
that says 'invalid argument'. Can anyone
help me to understand why the file
has gotten so out of hand and how to stop it.

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, and
some other problems, associated with images in OLE Objects.

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
 
Back
Top