Question : Handling pictures in Access

Through reading many posts on this site, I understand it is not a good idea to use OLE objects in Access because it will bloat the DB. However, my DB does require that certain photos be linked and viewed in forms and reports. My question is: how do I create a field that will store the photo link, not the OLE object. Secondly, is there a way to have this photo be viewed via the form and report?

thank you!

Answer : Handling pictures in Access

Open your form or report and set the Record Source to your table name with the Hyperlinks.  In the detail section insert an Image object and a textbox.  When you first create an Image box, you have to provide a picture file - which you can later remove once you have the outline established in the detail section.  Right Click on the textbox, click on the Format tab, click Visible - No.  Click the Data tab and set the control source to .  Now click on the Detail bar, click on the Events tab in the Properties List click On Format, click the ellipsis (...), select Code Builder and you will be in the VB Editor - where you insert the code I gave you above.  

When you load your table with hyperlink addresses it creates a string as follows:

###

In my case a typical hyperlink looked like this:

#Galapagos turtle#C:\Data\RTWPics\DPC_0331.jpg#
----------------------^-------- Here to Here ---------^-- This part is removed by the function in the Detail - On Format event

I never had a problem with hyperlinks, but OLE seemed to always want to bomb or bloat.  It takes a few seconds to load the pictures, but once loaded, you can scroll back and forth no problem.  When you close the form or report, the system releases the memory space taken by the pictures.  I had a report with 50 x 6 meg jpg pics.  I compacted and replaired - checked the file size - ran the report - and re-checked the file size - no difference.
Random Solutions  
 
programming4us programming4us