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:
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.
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?
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.
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.
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.
Hi, when the form is a continous one, all the pics will be the same one when first loaded and then when a path is click or after the update event, all pics will change to the latest one. Is there a way to solve solve this problem?
Nope. The only way is to link regular picture (or attachment) control to the field that contains data.
With the AccessImagine solution, the OLE control is bound to the field that contains auto-generated picture thumbnails.
Well actually there is a solution in MS Access 2007 or 2010. You could use calculated field in the query underlying the form which would store the picture path regarding to the actual record then assign this calculated field to ControlSource property of your image control on the form. For example the calculated field could look smth like that: imgStatus: IIf([tblGeneralTask].[MostRecentStatus]=”To Do”,[CurrentProject].[Path] & “\DBImages\Tasks\task-todo.png”,IIf([tblGeneralTask].[MostRecentStatus]=”Done”,[CurrentProject].[Path] & “\DBImages\Tasks\task-done.png”,IIf([tblGeneralTask].[MostRecentStatus]=”Active”,[CurrentProject].[Path] & “\DBImages\Tasks\task-clean.png”,IIf([tblGeneralTask].[MostRecentStatus]=”Cancelled”,[CurrentProject].[Path] & “\DBImages\Tasks\task-clean.png”,””))))
Hope this helps.
I have download the sample database, add new record in edit form, load an image to that new record. Then open the continuous form, the preview image do not show. I use Windows XP, Access 2003.
Hi, I need take photos and then store its in a directory called e.g. c:\alumnos\fotos ( I’ve made a macro that change the original image to his number of code) but it shows the same photo for all records, don’t change if I change of record. What I make wrong ?
Sorry for my english.
HA, sounds like Jose has the same problem as me :-)
I THINK that I’m getting over it by using the other tutorials… (http://access.bukrek.net/tutorial/continuous-forms).
I asked questions before reading ALL the tutorials.
Sorry, I’m a relative beginner in Access…
The utility is working flawlessly for me.
I am trying to get a report with captured images (Storing them as BITMAP for the corresponding records in DB), exported to excel.
Can anyone give any links or ideas how to achieve it?
Unfortunately, I do not know how to do this (
Hello. to be more clear, i’ve maked a short video about the error i get.
Here’s the youtube link.
That video looks quite strange.
Have you make any changes to demo DB?
Why that last record is so special?
Hello. I have downloaded the sample database.
I can edit the large images but I can’t show the preview in continuous form.
The issue started after the update to Windows 11. I have Windows 11 and Access 365 64 bit.
That is Windows 11 bug. Here is the fix – https://access.bukrek.net/down/windows11_bitmap_fix.reg
Download and run, agree to add keys to registry.