A mechanical injection device for injecting apportioned doses of a liquid drug. The injection device comprises a dose setting assembly comprising a cap and a cap receiving part, adapted to abut or engage with the cap when the cap is mounted on the injection device, and an injection assembly. Mounting and/or dismounting of the cap on/from the injection device causes the dose setting assembly to set a dose. Thereby a correct dose of drug is automatically set during a cap on/cap off cycle. Since such a cycle is normally performed between two subsequent injections, the number of steps required to be performed by the user is reduced.