How to show pictures in Access continuous forms

continuous

This article shows the proper way of image handling in continuous forms with the help of AccessImagine control. If you are looking for answers on some common questions about continuous forms, check the Continuous forms FAQ.

First of all just imagine one thing: time passed and you’ve got a 1000 pictures or so in your database. Every time you open continuous form with that images, your computer loads all of them at once. Surely it will have the hard time and even can freeze at once.

So what’s the solution? You don’t really need to show big pictures in continuous form. You need thumbnails. Thumbnails in OLE format for Access to handle it properly.

You can download the MDB file with entire solution to play with it:

Continuous pictures demo (Microsoft Office Access Database, 556 Kb)

.

Step-by-step

1. Lets assume you have AccessImagine picture control on your record edit form and its called Pic.

2. Create thumbnail field in your table (lets call it Preview) of OLE type.

3. Add On Exit event handler to your Pic control and insert this line:

if Pic.Changed then Preview.Value=Pic.PreviewOLE(128)

Now your Pic control generates a preview every time its picture is changed. Here 128 stands for preview longest side in pixels.

4. Create your continuous form, place Bound Object Frame on it and bind it to Preview field.

Now you’ve got continuous form with pictures, made in proper way.

4 Responses to “How to show pictures in Access continuous forms”

  1. Alec Bowden says:

    Not so clear to me! In your step-by-step how many forms do you have? A submission form and a separate continuous form? What goes in the preview field of the table?

  2. Max D says:

    I’ll try to explain better. Submission form I mean the form where you create/edit a single record.

    Second form is the continuous form, right.

    In the preview field goes the thumbnail of a picture, coded in OLE object format for “Bound Object Frame” control to display it.

    Feel free to ask more questions – it gives me an idea what has to be improved in this tutorial.

  3. Jerico C says:

    Hi. As in understand it you need to create an OLE field and bound it to your OCX right? but the problem with having and OLE field is that it will bloat your database. Do you have an alternative implementation that uses only the path?
    Im trying to make a continous form with preview pics on the side.

    • Max D says:

      Sure, you can specify path where to keep pictures. AccessImagine will do the rest of the job – creating & naming picture files, deleting old ones and filling proper names in database.

Leave a Reply

Comment Spam Protection by WP-SpamFree