Nz Function

jer

Registered User.
Local time
Today, 23:12
Joined
Nov 21, 2011
Messages
109
Hi
Im trying to put the Nz Function into the criteria part of my query. Basically I hace a list box that shows the tool number and description of a tool. However is the value of the the tool number = UNKNOWN how do I make it such that it will sub in the serial number instead?

tool numbers are stored in the field "Tool No#"
serial numbers are stored in the field "Serial No#"
description of the tool is in the field "Description"

here is the code i am using but i know that the Nz Function is used for null values so i dont know if i should be using this?
Nz([Tool No#],'[Serial No#]')
Any help would be great!
Thanks
Jer
 
IIf ([Tool No#] = "UNKNOWN",[Serial #],[Tool #])

But you should NOT BE USING special characters or spaces in Field or Object names.
 
Hi jdraw,

I know but I was new to access and had the db setup before I knew about that!
I tried the code and it doesnt work..
 
What exactly doesn't work? Error message???
I was responding to this
However is the value of the the tool number = UNKNOWN how do I make it such that it will sub in the serial number instead?

Please show all of the code involved.
 
I got it working
thanks alot!
Jer
 

Users who are viewing this thread

Back
Top Bottom