Remember that, as with the D40, the D40X doesn't have a built-in focus drive motor which means it can auto focus only with lenses which have their own drive motor (AF-S and AF-I lenses). If you want the lens to auto focus for you, make certain to check if it is compatible with the D40X. Otherwise you can still use the lens but ONLY in manual focus mode.
Fortunately I think there are at least 12 or 13 Nikon lenses that are AF-S or AF-I that will allow you to do just about anything you want.