My old thread was getting quite long so I started a new one with a similar topic.

Here is my script for a SQL query for access 2000;

SELECT Materials.[Description of Material], Materials.Manufacturer, Materials.[Manufacturer Part #], Samples.[Sample ID #], Samples.[Lot #], Tests.[Test ID #], Tests.[Start Date and Time], Tests.[Sample Area], Tests.[Counter Used], Tests.[Count Time], Tests.[Number of Counts], Tests.[Background Counts], Tests.[Alpha Counts], Tests.[Calculated Activity], Tests.[Detector/Counter Efficiency]
FROM (Materials INNER JOIN Samples ON Materials.[Material ID #] = Samples.[Material ID #]) INNER JOIN Tests ON Samples.[Sample ID #] = Tests.[Sample ID #]
WHERE (((Materials.Manufacturer)=NZ([Forms]![Search Database]![Combo16],[Materials]![Manufacturer])) AND ((Samples.[Sample ID #])=NZ([Forms]![Search Database]![Combo10],[Samples]![Sample ID #])) AND ((Samples.[Lot #])=NZ([Forms]![Search Database]![Combo22],[Samples]![Lot #])) AND ((Tests.[Counter Used])=NZ([Forms]![Search Database]![Combo14],[Tests]![Counter Used])));



I want to make sure that the NZ function is the correct funtion for what I am looking for. I want the query to check my form, in this case my search database form. If a value has been input in the form, it should use that value as my search criteria. If not, it should allow any value in that field to be shown in the query. So basically, if i define Sample 1 and Counter C as my query it should return all results for sample 1 and counter C no matter what manufacturer and lot #. Is this what the NZ function does? I just want to make sure, because I'm having some trouble with this query returning null results no matter what I input.