Thanks for the help, but it's still not working.
I removed the dynamic values from each of the text boxes, saved the page and then added the binding again. I copied and pasted your amended code into the web page at the location indicated but entering an invalid code simply re-loads the page and each text box is empty.
The page does recognise the error because if I enter all details correctly the form submits and the information is added into my database. It's simply not retaining the previously entered values or displaying the captcha error message.
I've attached the updated version of the file with the amendments you suggested included. Would you help me again please?