Display a Picture (OLE Object) on a form

G

Guest

I am trying to create a form which (among other things) will show a picture
associated with each record. The record source is a table with a column for
pictures , data type=OLE Object.
I copied a picture into one of the records and it showed up as 'package' in
the table. On the form I see the document(picture) name displayed in the
appropriate control box but not the actual picture. When I double click it, I
see the image and I can edit it. How do I get the picture to show up
immediately (not in edit mode) without having to double click?
 
S

Stephen Lebans

The application on your system that is registered to display the selected
Image type is not able to fully function as an OLE Image server in Access.
In this case it inserts the Image as a Package object.
What is the image type you want to insert as an OLE object?

Do you understand that embedded OLE images are stored as uncompressed
Bitmaps? Further, the uncompressed Image is actually stored twice for all
intensive purposes? This means you will not be able to store many images and
your MDB will quickly bloat in size? Do you really need to store the Image
an OLE object?

The accepted method is to NOT use the Bound or Unbound OLE Frame controls.
Instead use the standard Image control. In the Current event of a form or
the Detail section of a report, load the image into the Picture property of
the Image control with code like:

Me.NameOfTheImageControl.Picture = "C:\Wherever\TheNameOfYourImage"

See:
http://www.mvps.org/access/forms/frm0030.htm
(Q) Instead of storing the images in a table, I'm now string the path and
filename of the files in a table, and using the Image control. However, I
don't want the "Loading Image" dialog to come up. How can I hide this
dialog?

(A) The "Loading Image" dialog is popped up by the filter that's processing
the image. We don't have any direct control over it.

There are two ways to prevent the dialog from coming up.

1.. By changing a registry setting emailed to me by Klaus Oberdalhoff.
HKEY_LOCAL_MACHINE\Software\Microsoft\ Shared Tools\Graphics
Filters\Import\JPEG\Options

Change the ShowProgressDialog key value to "No".


If you go with standard Image control then you need to modify an entry or
entries in your Registry to disable the "Loading Image" dialog.
See:
http://www.mvps.org/access/api/api0038.htm

Here is a previous post of mine on this issue.
The one thing you must do is turn of the Loading Image dialog. If you don't,
and quickly scroll through the records in Form view, or page quickly in
Print Preview, you run the risk of crashing Access. Use the Registry mod at
the Access MVP site:


Additionally, two issues in regards to the Registry modification pointed to
here http://www.mvps.org/access/api/api0038.htm


1) The Registry key MUST be "No" NOT "no" or "NO"


2) On systems with XP or on systems with more than one user account,
you must add/modify the key in both HKEY_CURRENT_USER and
HKEY_LOCAL_MACHINE.



--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
G

Guest

I can tell you how I perform this function, although there may be a better
way. You did not tell me what version of Access you are using or what the
operating system is. I'll explain how I do it with Access 2002.

In your table you should name your OLE Object like oleMap or olePicture or
whatever you plan on displaying on the form.

Create your form; I assume it is based on your table or a query of the
table, where oleName is on the 'field list'. In Design View, drag your
oleName to the form. Switch to Form View | right-click in the picture frame.
Select 'Insert Object…' Select 'Create From File…' You can now type in the
path and filename or use the 'Browse' function in the dialog window. Locate
your file | click 'OK'. Now you have two more choices. If you leave unchecked
"Link" and "Display as Icon", Access will embed the picture into the program.
If you check "Link", Access will create a link to the picture, leaving your
database as small as possible. You stated you wanted the picture to show with
the record on the form. My suggestion is to 'Link' the picture. I have two
databases that I display pictures with each record on a form. In one database
I 'link'; the other I 'embed'. The difference in database size is striking.
Embedded pictures add so much size, you wouldn't believe it.

Hope that helps.
 
S

Stephen Lebans

Linked pictures will add roughly one half the size of an embedded image that
is not linked. A full size, uncompressed Bitmap is wrapped in a Metafile and
used to create a presentation Stream. This is the image you see within the
Bound OLE Frame control when it is not in the Active state.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
G

Guest

Jim,

Will you please review my post(s)? The subject line is: OLE - Package vs
Bitmap. I would like your opinion on how to fix this problem.

Thanks
 

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