Thanks Eugin. My query indeed runs on parameter that it gets from a form. I didn't know that it would be a problem. I will adjust my code, modify Browne's code to accept more parameters and post results here. I will also edit my previous post to be more standard (after a meeting of course...