any digital nikon lens will work on any nikon dlsr. i have lenses from WAY back, and they work well. Even lenses from the 35mm days. the difference is, for auto focus to function on a D40, you must have a lens with a built in motor, where with the d60, d80, etc, all have built in motors in the body, and can auto focus a lens regardless if it has its own motor or not.