Hi Ray, (and Bill):
Ole Object type controls in a table will always store the object within the
database. That the "Ole Type Allowed" be set to linked or embedded makes no
difference to the size of the storage.
If you are storing pictures the size of the database will also grow
considerably because Access stores them uncompressed as bitmaps, wether the
original file is a jpeg or not.
Another way to display pictures that are not stored within the database is
to use "Image" controls in a form. The Image control finds the picture in a
folder of your hard drive and displays it in the original format, for
instance ".jpg" . The picture is not stored in the database and therefore
it's size doesn't change at all.
Which control type to use, and wether you store or not, depends basically on
how you want to view the pictures... how you have to display them.
If you can view them one record at a time, with the form's "default view"
property set to "Single form", then you don't need an Ole Object type of
field in the table. You will need some field, either in that table or in
another one, with the ddress of the pictures in the folder in your hard
disk.
For instance in a products table you would have a text field that names the
picture for that product (say, "pic") Then you can either have a field for
the full address of the folder (say, "path") or refer to it in the form's
module window. you trigger the picture event with a command button or the
forms Current property, such as:
Private Sub Command36_Click()
Me!Image35.Picture = Me!ProdPath & [ProductsByCategorySfrm2].Form![Pic]
End Sub
' where the [Pic] is in a separate subform, in another table.
Or, if you don't have a path field and your pics are all in one place, then:
(This report is a catalogue with a several hundred pictures, none of them
bound and using an "image" field)
Private Sub GroupHeader5_Print(Cancel As Integer, PrintCount As Integer)
If Me!Pic = "Empty.jpg" Then
Me!pHOTO.Visible = False
Else: Me!pHOTO.Picture = "C:\MyDocuments\Products\Jpegs\" & Me!Pic
End If
End Sub
The "Empty.jpg", or blank picture, is necessary to display something when
there is no pic, or make the control invisible until a valid pic comes
along.
Now, the second option: If you want to view the pictures in continuous
forms, then you have to use Ole Object fields, bound object frame controls
and a big database. This is because Access will refer to the picture on the
record that has the focus (and you'll see lots of the same pic if you use an
unbound image control...) Bound Object Frame controls are the only way
Access can deal with different pics displayed per record in a continuous
form.
The good side of all this is that Access behaves quite nicely regardless of
the size of the data. Picture databases of over 3 Gb that work very light
and fast are quite common. I'm building one with 6800 pics that grew to 4.5
Gb so far and it's working like a charm!!
Hope this helps