Access DB, linked images, memory problems

G

Guest

I have a DB with one OLE field, linking to BMP image files, the images are
NOT imbedded.

I have loaded links for about 35 records, but when I try to add another link
(there are 175 recs total to be updated with link to the image file) I get
the following error:
"There isn't enough memory to complete the Automation Object operation on
the bitmap image object".

Any clues to how to solve this problem?

I'd use hyperlinks instead if there was a easy way to print the hyperlinked
file on a report, which I can do with the linked OLE object
 
G

Guest

If you simply store the path to the image files in a text field you can
assign the path to the Picture property of an unbound Image control in a
form's Current event procedure or in the Print event procedure of a report's
Detail section. All you are storing in the database is the text data so you
avoid all the overheads of storing or linking to images.

In the case of a form the form must be in single form view, not continuous
form view as in the latter case assigning the path to the control's Picture
property would just show the same picture in every row of the form.

For easy entry of the path into the text field you can open a common dialog
which allows you to select the file and returns the path as a string which
you can then assign to the field in the current record.
 
G

Guest

Ken,

The images I wish to load are to be printed in a report [are bound], one per
page [images are scanned docuemnts]. How do I go from a text link to getting
the image on the report?

Thanks for your assistance,

Mark
 
G

Guest

Lets assume the paths to the image files are stored in a text field
ImageFilePath you'd first add a text box bound to the field to your report's
detail section and set its Visible property to false (No in the properties
sheet) to hide it. Then add an Image control to the Detail section in your
report, which should include the field in its and size it to fill the page,
or whatever part of the page you want the picture to occupy.. When you add
an Image control to a report in design view it will prompt you for a file.
Just select any image file and then in the control's properties sheet delete
the entry for its Picture property, confirming that you do wish to do so when
it prompts for confirmation.

In the image control's properties sheet select Zoom as the SizeMode property
so that the picture fills the control but retains its proportions. For its
PictureAlignment property select how you want the picture to align in the
control of it doesn't fit the proportions of the control exactly (centre, top
left, top right etc).

Next select the detail section of the report by clicking on the section's
header bar or any blank area within the section in report design view. In
the section's properties sheet select the On Print event and click on the
build button (the one on the right with 3 dots). At the next dialogue select
Code Builder. When the VBA window opens at the Print event procedure enter
the following line between the two lines already in place:

Me.YourImageControl.Picture = Me.txtImageFilePath

substituting the actual name of your image control. Also in the detail
section's properties sheet set its ForceNewPage property to True (Yes in the
properties sheet) to After Section so that each image is on a new page.

You can do exactly the same with a form in single form view as in a report.
The only difference is that the line of code would go in the form's Current
event procedure.

The above does assume that each record includes a path to an image file. If
the path could be Null then you should hide the image control, so the code
would be:

Me.YourImageControl.Visible = Not IsNull(Me.txtImageFilePath)
Me.YourImageControl.Picture = Me.txtImageFilePath

With .bmp files the pictures will load seamlessly. With JPEGs a progress
meter pops up each time. If you want to suppress this use the following
registry hack:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Graphics
Filters\Import\JPEG\Options]

"ShowProgressDialog"="No"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top