nz function

  • Thread starter samotek via AccessMonster.com
  • Start date
S

samotek via AccessMonster.com

Will you help me build the proper code including cases when there is a Null
value.I have the following code :
If Me![Stueck] <> Nz(Me!In - Me!Out, 0) Then
Me!Stueck.ForeColor = 255

However i do not want to show this color when there is no value in the Out
text box.
For example
in out stueck
15 15
i cannot get this solution.The above code gives me a red color when i have
In = 15, stueck = 15 and nothng in out.
 
P

Paolo

Hi Samotek,
If me!out is the value that can be null, do the nz trick on this value i.e.

If Me![Stueck] <> Me!In - nz(Me!Out, 0) Then

so, if me!out is null 0 will be assigned and your if will work.

HTH Paolo
 
Top