Thanks PeterH for that, I know of get it, it does seem more complicated than it sounded initially!
I can get each step working at least, so I'm not totally useless, well nearly
I will try and get it sorted, but it might have to wait till the weekend, work always gets busy when I bring a lunchtime project in!
If anyone has time to give a sample line of Code for the sections PeterH mentiond in his last paragraph, I would really appriciate it. (just a quick sample one line then I at least know what I should be using, and can look at other samples, thanks joejet
define a set of constants defining the states
a variable holding the current state,
And a switch statement to test for