When I first posted I did not see the function calls because you had place 3 code sections. Hence my refernce to I should see. Because I did not see it initially.

The main point I was trying to make:
You should not reference global variables inside functions. It is bad form and as you saw can cause you issues that are harder to diagnose. Check your input parameters to validate that they contain the proper data.
_________________________
Home page: http://www.kixhelp.com/hb/