Create a database with pictures

E

ElvenMage

I want to, for example, make a database of all the books I have in Access
2007. I would like each entry to have a picture of the front of the book to
make it more user friendly. I can't seem to find that option, though.

Thank you.
 
D

DM

create a field in the table as OEL Object. then when you add the field to
your form for imputing data, you can, in the data view, right click that
field and insert object and select from file.

this works for me in Access 02 SP3
 
E

ElvenMage

When I did this, the picture was there, but only as a link. I want to
actually have the picture be viewable. Thank you anyway.
 
D

DM

sorry, not familiar with Access 07.

Hopefully an MVP will see your cry for help. I only provide help from
experience.

Out of curiosity, are the pictures in the same directory (exp:
c:/mydocs/databases) as the database or are they stored on a shared network
drive?

I also went back into my database to check some things. mine is using MS
Photo Editor as a driver if you will to maintain the picture in the form and
reports. in the form view, if I double click the photo, it will open in MS
Photo Editor.

If you wish, I could email you a copy of my db to see.
 
D

DM

Thanks, I just started doing this last week. Storing photographs of
signatures of instructors to auto sign certificates to electronically send
the certificates to students in email.

I just started a directory for my church and after reading your post, I took
a look at the size of my db. It was 2K. I embedded a picture and it went to
3K. I read your articles and linked one. jumped to 5K. I replaced the
picture that was linked to test if it would update, which it did and now I
am up to 32K.

So, am I doing something wrong or is storing pics, embedded or linked, size
consuming?
 
P

Pete D.

Storing the pictures in the file will kill your data file, especially when
it hits 2gb. Access 2007 improves on this with attachments which stores
them in a special format but still grows quickly. Store the link/path to
the file and display it in your form in the image control."DM"
 
V

viktor chuzhakin

ElvenMage said:
I want to, for example, make a database of all the books I have in Access
2007. I would like each entry to have a picture of the front of the book
to
make it more user friendly. I can't seem to find that option, though.

Thank you.
 
L

Larry Linson

DM said:
So, am I doing something wrong or is storing pics, embedded or linked, size
consuming?

The imaging examples, with article, at http://accdevel.tripod.com, explain
what's happening to you and offer some alternative approaches -- that
article has not been updated for Access 2007, but yes, OLE Objects, even if
linked, will cause database bloat, in Access 2003 and earlier.

Larry Linson
Microsoft Office Access MVP
 
D

DM

thanks for this article. I was just trying to do the store links and image
control with much dificult. if followed the steps below this email and cant
get the pictures to update to the respective detail. the picture I select in
step 3 substep 5 remains on every detail. I am currently looking for my disk
to check the Northwind sample for copying.

also, can I go in and delete all the embedded images to reduce the bloated
file back down to reasonable size?


Add a picture or object that changes from record to record
You can use an image control to display a bound picture in a form, report,
or data access page. To display a bound embedded or linked picture or object
on a form or report, you must create a bound object frame.

Add a bound image control

1.. Do one of the following:
a.. To display pictures that change from record to record without
storing them in a table, create a text field to store the locations of the
image files. You must store the locations of the pictures in a text field if
you want to display the pictures in a data access page. You can also use a
text field to store the location of pictures and then use those pictures in
a form or report, but you must use Visual Basic event procedures to display
the pictures.
2.. Open the form, report, or data access page in Design view.
3.. Do one of the following:
In a form or report, add an image control that is bound to a text field
containing the paths to the pictures

1.. If the field list isn't displayed, click Field List on the toolbar.
2.. From the field list, drag the field that contains the locations of
the pictures to the form or report.
3.. In the toolbox, click the Image tool .
4.. On the form or report, click where you want to place the object.
5.. In the Insert Picture dialog box, specify the path to any picture,
and then click OK. For example, you can type the path to the picture for the
first record.
6.. Double-click the form selector or the report selector to open the
property sheet.
7.. Click the Build button next to the OnCurrent property box, and then
click Code Builder in the Choose Builder dialog box.
8.. Create the following event procedure. Substitute the name of the
image control on your form or report for ImageControlName and the name of
the control containing the path for ImagePath.
Private Sub Form_Current()On Error Resume NextMe![ImageControlName].Picture
= Me![ImagePath]End SubNote that if you are adding the event procedure in a
report, the first line of the procedure will be the following:

Private Sub Report_Current()9.. On the File menu in the Visual Basic Editor,
click Close and return to Microsoft Access.
10.. Click the control that is bound to the text field containing the
location of the pictures, and then click Properties on the toolbar to open
the property sheet..
11.. Click the Build button next to the AfterUpdate property box, click
Code Builder in the Choose Builder dialog box, and create the following
event procedure. Substitute the name of the image control on your form or
report for ImageControlName and the name of the control containing the path
for ImagePath.
Private Sub ImagePath_AfterUpdate()On Error Resume
NextMe![ImageControlName].Picture = Me![ImagePath]End SubThis event
procedure enables you to add or change a picture location in Form view.

12.. On the File menu in the Visual Basic Editor, click Close and return
to Microsoft Access.
Note To see an example of an image control that is bound to a field
containing the locations of pictures, open the Employees form in the
Northwind sample database.
 
L

Larry Linson

DM said:
thanks for this article. I was just trying to do the store links and image
control with much dificult. if followed the steps below this email and
cant
get the pictures to update to the respective detail. the picture I select
in
step 3 substep 5 remains on every detail. I am currently looking for my
disk
to check the Northwind sample for copying.

If it's a Form, then sounds as if you aren't executing the code (which you
quote) in OnCurrent event; if a Report, corresponding code is executed in
the Print event.

If you are trying to display pictures in Continuous Forms view, the only way
that will work is the OLE method -- to use the other approaches I describe,
each record must be displayed separately. For Forms with pictures, that has
not proven to be a problem for my clients and users. YMMV, as it's a matter
of personal preference; on the other hand, when I explained the tradeoffs in
cost, bloat, etc., my clients have chosen "efficient" over "someone's idea
of esthetic".
also, can I go in and delete all the embedded images
to reduce the bloated file back down to reasonable size?

You have to choose an image file to create the Image control, but IIRC, you
can delete it. To recover the space, however, after deleting the embedded
images, you'll need to do a Compact and Repair.

Larry Linson
Microsoft Office Access MVP
 
Top