Be careful when switching a motor (or other inductive load) this way - put a flyback diode across the motor, otherwise, when you switch it off, the motor can generate a high voltage (momentarily), and the transistor can be destroyed.
I had a similar issue in a friend's car the other day - his in-car electronic thermometer was resetting itself every time he used his air horn (his new toy...). A 1N4004 across the horn solenoid fixed it 8)