Posted by hbugalOn your D40 you need the 50mm AF-S 1.4....any other lens, while it will work on your camera, WILL NOT autofocus...