That worked a treat using the controls code before the next bit.

Thanks that has had me stumped for days.