The lenses are all Nikon F-mount lenses. The (basic) difference is that the D90 will autofocus with older AF-D lenses, both on the used market and for the few lenses that Nikon hasn't yet converted to AF-S versions. Given the difficulty of selling a used D40x for a good price, it'll only pay for itself if you're going to spend significant money on a lens that either doesn't have an AF-S version or a Sigma HSM equivalent that's about as good and not significantly more- for instance, an 80-200 AF-D doesn't cover the delta compared to an 80-200 AF-S, but if your only choice was a 70-200 AF-S, then the spread would be covered. So, you'd have to figure out what lenses you wanted to get, what their alternatives where, then do the math.