Zip up your CURRENT code, as in the code that fails, and attach it to your post. Don't include any huge blocks that are commented out, and don't include any functions that aren't actually called. The stuff is hard enough to read. One hopes, coming out the other side of this, that you will have learned how to rationally whittle down your code to the parts that actually have an effect on the operation that is failing. I supect that you are having scope resolution issues, but we shall see.