Show image for specific record on report based on yes/no value

S

SandwichUK

Hi,
We have a product database which has several yes/no categories for
each record, I would like to be able to show an image on the report
based on which yes/no boxes are ticked.

So, we have a list of plants in our database that have yes/no columns
named "Sun", "Shade" or "Semi-Shade" (depending on what aspect they
like) I have a different image for each option (named the same .jpg)
and I would like the relevant image to show up on the report for each
record if it is true, so the report is easier to scan with images
rather than text. Any ideas on how I could do this?

Thanks in advance.
 
D

Duane Hookom

I would probably just place the images in the report and then use code in the
On Format event to set the visible property of the images.
Assuming you have a text box "txtSun" bound to the yes/no field [Sun] and an
image control named "imgSun", your code might look like:

Me.imgSun.Visible = Me.txtSun
 
N

NetworkTrade

in general; put all 3 onto the report.... put the controls on top of each
other....and make their property 'visible' as 'no'

then in the 'OnFormat' event for that section; add some VBA:

If me.Shady=yes then
Me.ShadyImage.visible=true
end if

depending on the layout of the report section you may have to add VBA to
again turn that visible to off either at the beginning or end so it does stay
visible - but with some experimentation you should be able to get it....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top