Monday, September 15, 2008

Using Pictures in Reports and Forms

The Problem: Large Access database size even after compacting.

Evidently, Access converts pictures into bit map (.BMP) file and a small .jpg or other type of compressed picture is therefore expanded to a larger size. In addition, if you started with a large file that you then scaled to fit in the corner of a report or form the original size is still the size that is stored in your Access database. The result is, everytime you create an additional report in your database (perhaps copying from a already created report), that has two logo images in the reporter header and page header, your database increases in size by 2 MEGABYTES! (if the picture file, expanded is 1MB, which is not that big for a picture file).

Yikes!

The solution: There are two possibilities.

1. If the the database is local, or if the tables are on a shared file server, but the forms, reports, etc are local you can link to the picture instead of embedding it (this is one of the properties for the picture control on the form or report) - this requires the picture file to be on everyone's computer as well as the .mdb file. If the database is shared on the file server, you'll have to make sure the network speed is fast enough not to create an unacceptable delay when opening the reports.

2. The second option, if you embed the picture is to transform the picture to a bitmap or GIF file to begin with so at least you know how large the picture file is. Try copying and pasting the picture into Word, scaling it to the right size and and 'cut'ing and 'paste special' to select a different format. Bitmap will be big but keep some quality, HTML and GIF are smaller but lose quality and perhaps total number of colors.

To have more control you'll need to use a real graphics application such as GIMP. I thought one might be able to save the picture as a GIF file with a transparent background. However, I've read that this i still a problem as access will take a transparent background and add a background to it.

No comments: