While you can find a lot of products that work great against fleas, regardless of their life stage you might have problems with other insects as well. Carpet beetles can too be affected by flea spray. Look carefully on the label, and there you might find how the spray fares against such insects.
However, there are products that state something, and then you find out that they don’t quite work the way you wanted them too. But don’t worry, there are more than enough options on the market that work great against both fleas and carpet beetles, you just have to pay attention.