Stepper driver steps not accurate

Robin2:
You should not have the line

tableSlider.run();

inside any IF statement. It should just be inside loop() so it is called as often as possible. The library will stop sending pulses when the motor reaches its destination

I'm not sure if you should be using moveTo() or move()

...R

I tried moving tableSlider.run(); out of the IF statement and it acted the same, the stepper moved the assigned amount of steps and stopped but a button press wouldn't start it again.

I tried move() instead of moveTo() and the stepper didn't move at all so I went back to moveTo().

The only problem I have is making the stepper move every time I press the button. On the old code I would just change the STATE of the button to low and the stepper would move on the next press of the button but the Accelstepper doesn't seem to allow that.

Perhaps I need another IF statement to change the button STATE ?