Iff statement to show pictures

  • Thread starter Thread starter Aamer
  • Start date Start date
A

Aamer

Is it possible to use Iff statement to show pictures
Actually I am trying to use tow different pictures on the form if the value
is less than 0 or higher than 0



example
=IIf([Text135]<0,"","Pictue B")
=IIf([Text135]>0,"Pictue A","")


How can I Do This

so far i am unable to fix this issue



Regards

Aamer
 
You can nest IIf statements.

It's not really clear what you're trying to do, since your sample code
doesn't actually assign a value if the value is less than 0. Assuming you
want Picture B if it's less than 0, Picture A if it's greater than 0 and
nothing if it's equal to 0, you'd use

=IIf([Text135]<0,"Picture B", IIf([Text135]>0,"Pictue A",""))
 
First change the name of Text135 to something that makes sense.

I would have both pictures in the form and set their visible property with
code like:

Me.imgPictureA.Visible = Me.txtMakesSense < 0
Me.imgPictureB.Visible = Me.txtMakesSense > 0

You would need to call this code from the On Current and the After Update of
txtMakesSense.
 
Aamer said:
Is it possible to use Iff statement to show pictures
Actually I am trying to use tow different pictures on the form if the
value
is less than 0 or higher than 0



example
=IIf([Text135]<0,"","Pictue B")
=IIf([Text135]>0,"Pictue A","")


How can I Do This

so far i am unable to fix this issue



Regards

Aamer
 
Back
Top