Solved
Thanks for the replies Mr D and Rolebama your responce is much apprecaiated,I tried both methods but to no avail,borrowed a handbook from a neighbour and could find no reference as to what happens to the immobiliser when the power is disconnected and as I later found out nothing,it's not like the radio,what I done then was to check what fuse was for what and found the fuse for the ECU was loose,put in a new one and the keypad was back to normal,it did not lose the code while I had the battery out for a couple of days,I first tried charging it before I sold the house and bought a new battery,thanks again guys.
Jim :D