>Please modify your following codes to work with VFP6
Tariq,
See Craig's answer for one way to do it. On Error will work but is very primitive and not very powerful command. You should consider upgrading to VFP 9.0 that is sooo much better and modern. VFP6 is a very old version.
"Once again, we come to the Holiday Season, a deeply religious time that each of us observes, in his own way, by going to the mall of his choice." -- Dave Barry