How do you know it's bad and in need of repair?
Try this - it's quick and cheap... cut 6" off the power cord at the plug end - throw it away and fit a new plug
My guess is that constant cable tugging has caused the conductors to stretch and break inside the cord.
Of all the vacuum cleaner repairs I've done 75%+ have been this - never needed to replace on/off switch.
Alternatively get hold of a new switch - remove the old and fit the new taking care to connect the wires as before - a 'photo often helps to get it right.
Good luck...
Peccavi
January 2013