Switching a picture on and off using an iif then statement

K

Kneepop

Please can someone suggest a solution to this:
=IIf([6 HARM ENVIRO]=True,![J:\COSHH & REACH\Enviro.jpg],0)

J:\COSHH & REACH\Enviro.jpg being the name and file location
I just get "#Error" when [6 HARM ENVIRO]= True and "0" when false.
Where am I going wrong???

Thanks in anticipation
 
T

tina

i'm guessing that you put your posted code in the picture control's
ControlSource property, correct? instead, try adding the following code to
the AfterUpdate event of control [6 HARM ENVIRO], as

Me!PictureControlName.Visible = Me![6 HARM ENVIRO]

so when the value = True, the picture control is visible, and when the value
is false the control is hidden. if you use the form to display existing
records as well as entering new ones, you'll want to put the above code in
the form's Current event procedure, too.

hth
 

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