Before you do anything else - cut away the plug and a few inches of cord - fit a new plug and see what happens.
Of the vacuums I've repaired this fixes 75% of the faults - it costs little and takes barely 10 minutes.
Constant tugging over time stretches the wires in the cable until one of them snaps in two - sometimes making a connection and sometimes not.
I have never had to change an on/off switch other than on a Dyson.
Good luck...
J Edgar Hoover, October 2014