Thanks for your help,

I have transfered your code (i can see where I went wrong) (yours is a better way)
and it works well,
I have decided to run the switching code in a 12F675 on its own as I had run out of ports on my 16F627,

(Just to put you in the picture the unit is part of a two way radio repeater, and the coding was to switch between to linking radios.)

Cheers
Dave...