Post your whole code - otherwise no-one can see exactly what you're doing.

Regards
Alan