I have a table called "AncestryDetails" which has several fields for photos, imbedded JPG files which generally are pulling into my report the way I want them to. Two of them are essentially thumbnails and they look fine with fixed image boxes holding the space if there is no picture.
The third photo is a field called "Photo" which prints as the last field in each record in an image box called "image23". Only a few selected records will have a photo in "image23", these images are typically bigger, so I would like "image23" to not be visible (and not take up the space on the page) when there is no embedded image in the "photo" field.
So my plan was to write some code within the report in the "details" container in the "On Format" line to say:
If the value of the field called "Photo" is null or "" or blank, then
Image23.height = .1
image23.visible = false
Image23.border=transparent
Else
Image23,height = 2.5
image23.visible = true
Image23.border=solid
End if
I am typing this out in layman's terms because I can't get the syntax right. I am self-taught so either a bad student or a bad teacher at this point, not sure which. Probably both. I dearly wish I had taken some proper coursework when younger to be able to speak VBA better. I am guessing there is a simple painfully obvious answer to someone other than I, who knows what they're doing, and which can be offered up in 3 minutes.
Thanks in advance, Jonathan
P.S. Even better would be to set the height of the image box to be equal to the height of the JPG image, but if that is too elaborate, I will deal with a fixed height and work around the image sizes, select different pictures, or whatever, to make it work visually.