Well, you'll have to post the code, because it is impossible for someone to say what is wrong.

Regards