Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with displaying Null field in a query criteria

Status
Not open for further replies.

marcin2k

Programmer
Jan 26, 2005
62
CA
here is my criteria so far,
IIf(Nz([Forms]![fLAMPREditProd]![txtInt2ID],0)=0,Null,[Forms]![fLAMPREditProd]![txtInt2ID])

The False part of it works but whenever the txtInt2ID textbox is empty then the True part does not display Null records. It does not let me put "Is Null" because its a Number field, any idea on the error or a solution to it?
Thanks
 
Hi
Do you want it to _say_ Null records? I am a little confused, because you are using Nz to get rid of nulls.

To say Null:
IIf(Nz([Forms]![fLAMPREditProd]![txtInt2ID],0)=0,"Null",[Forms]![fLAMPREditProd]![txtInt2ID])

 
try iif(Forms!fLAMPREditProd![txtInt2ID]>=0,Forms!fLAMPREditProd![txtInt2ID],"Null")

As long as the value can't be negative I think this will work for you. This doesn't address your specific issue but it could be a quick work around if your not tied into determining the exact problem.
 
Something like this ?
WHERE Nz([your number field],0)=Nz([Forms]![fLAMPREditProd]![txtInt2ID],0)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Its not leeting me use "Null" saying its too complex to evaluate. I think it has to do with that this field is a number field instead of a string field
 
Thank you all, Got it to work with your code PHV, i basically just put
Nz([your number field],0)=Nz([Forms]![fLAMPREditProd]![txtInt2ID],0)
in my criteria and it works like a charm

:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top