How can I repair my hammer drill?
Really old question, but here goes.

Inside the drill, this is the gear that will make the Hammer action (an un-related example) 
 As the drill turns, the ratchet action of caused from the teeth sliding against each other creates the hammer action you feel in Impact Drills. 

The Switch to activate this is obviously failing in your drill. 

The Complicated image below describes your problem. 

The Drills drive shaft (#3) in the pic, either makes heavy contact with the ratchet (2) or not. depending on its vertical position (how left or right the shaft sits on in the casing) That position is determined by the shifter knob (point #1 /A) as you turn that knob, the plastic resses is either deep or shallow and makes the shaft either engage the impact driver or not. 

There is a spring (at point B) which applies constant pressure on the shaft, making it always want to be in a certain state (either hammer or not depending on drill) 

Essentially, you need to push the drive shaft (3) out of hammer drill.. check if the knob (A) is somehow broken, or if the Spring (B) has collapsed and not giving any push.

Alternatively, if you are feeling brave, you could try to remove one of the sides of the impact driver, thereby disabling the hammer action completely.