Iff statement to show pictures


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
 
Ad

Advertisements

D

Douglas J. Steele

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",""))
 
D

Duane Hookom

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.
 
D

De Jager

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
 
Ad

Advertisements


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

Similar Threads


Top