Images on reports

Sym

Registered User.
Local time
Today, 06:33
Joined
Feb 21, 2015
Messages
40
I have a report that will require multiple images but that number will vary depending on how many records are included in the report. Each record will have a total of 4 images so for example lets say company A has 40 records that would mean i need a report that has 80 images. I want to print out that report or export it to pdf and send it to them but then company B has only 1 record so that report would only need to show 4 images.

I know how to insert a image control and link to file path for that image and I was thinking to make this report i would need to make a report with the maximum number of images i can think of (lets say 80 for this example) then add vba to the On Load funtion that hides the null image controls that arnt needed but how do i make it so the section of the report with the image controls shrinks so i dont have a huge blank space in my report filled with empty image controls? I have set the section to can shrink but that doesnt work. Is there any way to do this?

thanks
 
maybe set the height and width properties of the image control. they are measured in twips (1440 twips = 1")
 
Please clarify - each record has 4 images. company A has 40 records that would mean i need a report that has 80 images. Wouldn't that be 160 images?

And how is it a problem? - a record in the detail section would have 4 image controls so if there are 40 records, that would be 40 records of 4 images in the detail section, If they have only 1 record, that would be 1 record in the detail section.
 
Are you using Access 2010 or later?

If yes then this is very simple.

I will assume you have a normalized database design where there is a child/sub table with one record per image that has a field to store the file path.

If not, then you can create a union query to simulate a normalized design.

I know how to insert a image control and link to file path for that image

That is as simple as binding the image control to a field with the the file path. NO VBA code required! :)


If you have 2003 or older, the upgrade is worth it just for the better image handling.


and I was thinking to make this report i would need to make a report with the maximum number of images i can think of (lets say 80 for this example) then add vba to the On Load funtion that hides the null image controls that arnt needed but how do i make it so the section of the report with the image controls shrinks so i dont have a huge blank space in my report filled with empty image controls? I have set the section to can shrink but that doesnt work. Is there any way to do this?
No need to do it manually. Let Access do it all for you.

I would use a sup report for the images from the child table. One image control in the detail section bound to the field with the path.

Done.

Look Ma' No VBA code. :D
 
Please clarify - each record has 4 images. company A has 40 records that would mean i need a report that has 80 images. Wouldn't that be 160 images?

LOL oops, yeah sorry that should be 160...math is hard :P
 

Users who are viewing this thread

Back
Top Bottom