Total re-write of the end of the ERROR section. Hope you can use this guys. Nothing like the 11th hour...