Switching a picture on and off using an iif then statement

  • Thread starter Thread starter Kneepop
  • Start date Start date
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
 
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
 
Back
Top