If IsNull and Zero?

  • Thread starter Thread starter Dave Elliott
  • Start date Start date
D

Dave Elliott

How can I make this code also NOT show the label if Text362 equals 0

Me.Lbl383.Visible = IsNull(Me.Text362)
 
Dave Elliott said:
How can I make this code also NOT show the label if Text362 equals 0

Me.Lbl383.Visible = IsNull(Me.Text362)

That's going to show the label only if Me.Text362 is Null. Is that what
you had in mind? That doesn't make sense, because then the label will
already not be shown if the value is 0. So I'm not sure what you really
want.

If you want to show the label only if the textbox is either Null or 0:

Me.Lbl383.Visible = Nz(Me.Text362, 0) = 0

If you want to show the label if the text box is neither Null nor zero:

Me.Lbl383.Visible = Nz(Me.Text362, 0) <> 0
 
Thanks, That is exactly what i was wanting.

Dirk Goldgar said:
That's going to show the label only if Me.Text362 is Null. Is that what
you had in mind? That doesn't make sense, because then the label will
already not be shown if the value is 0. So I'm not sure what you really
want.

If you want to show the label only if the textbox is either Null or 0:

Me.Lbl383.Visible = Nz(Me.Text362, 0) = 0

If you want to show the label if the text box is neither Null nor zero:

Me.Lbl383.Visible = Nz(Me.Text362, 0) <> 0

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 
Back
Top