iif condition

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How to show or hide an image or a text box connected to a iif condition
???

iif(number=0;image A;imageB)


Thanks - Ciao !


Roberto
 
I expect you would need to write code in some event like:

IIf Me.txtNumber = 0 Then
Me.ImageA.Visible = True
Me.ImageB.Visible = False
Or
Me.ImageA.Visible = False
Me.ImageB.Visible = True
End If

or you can use:
Me.ImageA.Visible = (Me.txtNumber = 0)
Me.ImageB.Visible = (Me.txtNumber <> 0)
 
Oops, just noticed I used IIf rather than If and Or rather than Else....
If Me.txtNumber = 0 Then
Me.ImageA.Visible = True
Me.ImageB.Visible = False
Else
Me.ImageA.Visible = False
Me.ImageB.Visible = True
End If

or you can use:
Me.ImageA.Visible = (Me.txtNumber = 0)
Me.ImageB.Visible = (Me.txtNumber <> 0)
 

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

iif CONDITION 1
Access My Expression Contains Wrong number of arguments 0
IIf question 7
SQL IIF statement with TOP 10 0
IIF alternative in query 2
sum iff 2
Help in Coding please. 4
Blank in Listbox 1

Back
Top