Adding images to a report

Raj Mann

New member
Local time
Today, 14:38
Joined
Sep 26, 2008
Messages
9
I am new to VBA, i want to display images in a report however if there is no image for a particular record then i get an error message. I think i need some sort of If statement such as
If there is no image then still display the report with the information but not the image.

This is how i have set it up:

i have images stored in a folder on a shared area
I have included on the report an ImageFrame
In the group Header section ON FORMAT i have included the following VBA code

Me![ImageFrame].Picture = Me![ImagePath]

Inside the table i have included the path to the folder where all images are stored (Field Name = ImagePath)

The problem is if there is no image for that record then i get the error message:

Runtime error 13
Type Mismatch


Any help would be much appreciated. THANKS IN ADVANCE.
 
First only post questions in one place on the forums please.

Second, make a 1 x 1 pixel picture with mspaint and call it blank.jpg
Use an IIF statement to determine of there is no picture and have it return blank.jpg if none exists in the folder.
 
Can you tell me how to write the IIf statement please?

I am new to VBA

Many thanks
 
an iif statement has the following syntax:

IIF(Condition to test, "What happens if true", "What happens if false")
 
How can i determine if there is no picture in the images folder?

If i put

IIF [ImagePath] = "" then ImageFrame = ""

this doesnt work becuase Every record has an imagepath but may not necassarily have an image in the images folder?

hope that makes sense
 

Users who are viewing this thread

Back
Top Bottom