Don't store your pictures in your database. Store them in a folder and
provide the file path to the folder in a text field in your database.
Here's a step by step which works with previous versions of Acc
(the instructions may be slightly different for Acc2007 and it would be
very helpful if you could edit these instructions, if necessary for 2007
users)
Create a table TblImge with
ImageID (Autonumber, Primary Key),
ImgPath, (a text field)
ImgName (a text field)
ImgPath contains the path to the folder that contains your images eg
E:\Downloads\EvsPhotos\Students\
If this is the same path for most of your photos then you can set it as the
Default Value of the ImgPath field in your Table Design View
ImgName has the full name of your picture/photo, including the file
extension. eg
John.jpg
Keeping path and name separate will be helpful if you every need to move
your photos.
The first record in your TblImage will contain the file path to the default
picture (or clipart) which you want to use if you don't have a picture for
anyone.
Add the photo paths and filenames to this table. (if you have a lot of
pictures there is code which can help you to do this)
In your table which has eg Students add the Number Field ImageID
Make its Default Value the ImageID number of your default image (probably 1)
If you have lots of records in your table already, you could use an Update
Query to update this field to 1 until you have matched student and picture
In the query on which your report or form will be based, as well as the data
from eg your Students table, add ImgPath and ImgName. In an empty column in
the query (in Design View) type
PicPath: ImgPath & ImgName
(this will join the ImagePath and File Name together)
In your report, in Design View go to Insert, Picture. Choose any picture or
clipart to start with - it doesn't matter.
Size the frame to the size you want it to be.
Click the the newly inserted frame, click on Properties
On the Format tab, next to Picture, delete the file path next to Picture.
Choose Yes - you want to delete the picture.
Next to picture, it will now say (none)
Your Image Frame will remain as a white square. On the Other tab next to
Name type Pic1
Next to Size Mode choose Zoom.
Click on the grey bar above above the section which holds your picture
frame.
In Properties, click on the Events tab and next to On Format. Choose Event
Procedure.
Click just right of that to open a code page
In the code page just above where it says End Sub put
Me.Pic1.Picture = Me.PicPath
Evi