Thanks for your responses,
I got that problem fixed. But now have another problem. As you can see in my code, i use a check box for one of the criteria. Well, with this code if the check box value is zero. OR not checked, then the isnothing function returns, nothing and the following code is not run. Now the check box is in triple state mode, so that if it is null, i don't want it to be included in the criteria, but if it is blank, or unchecked, then i do want it inlcuded. In other words, even though the value is zero I still want the code in the expression to run. So, first i just stopped using the isnothing function but then the check box is included in the criteria everytime. I don't want this. So then i changed the isnothing function in the module to include zero values. But that didn't work either. Not sure why on that one. Do you have any ideas on how to achieve this?