YAY!

After what seems like hours I have finally cracked it and the application is now working fine.

Thankyou for all your help.

Kind regards,