Suppose the $4$ digit code be $1234.$
Hence, the number of letters possible is $10.$
Let’s suppose any $1$ of the ten occupies place $1.$
So, as the repetition is not allowed, the number of letters possible at place $2$ is $9.$ Now at $1$ and $2,$ any $2$ of the $10$ alphabets have been taken. The number of alphabets left for place $3$ is $8$ and similarly the number of alphabets possible at $4$ is $7.$
Therefore the total number of $4$ letter codes
\[=10\text{ }\times \text{ }9\text{ }\times \text{ }8\text{ }\times \text{ }7=5040.\]