Remember, when you buy your camera, the body is actually only going to be a small part of what you buy, you really are buying into a system and you lenses are most likely going to outlive a fair few camera bodies.
I cannot stress how important this point is

The quality of most consumer DSLRs are about the same, as are enthusiast DSLRs, as are Pro DLSRs (just compare like with like). The expanse of DSLR systems however aren't alike.
Simmo,
I would suggest that during your considerations you think abut where you'd like to go with photography, say in 5 - 10 years and look at what sort of kit would be required for that. Think about how you'll get there and how much it would cost now. Look into things like what the availability is
second hand and if you wanted to hire a lens could you?
I would also suggest that you should look at the DSLR body as a consumable item as within 3-5 years I suspect that if you've caught the photography bug you'll be looking at replacing. In contrast you should look at lenses as investments especially if you get the better quality ones as if you've bought a good lens you will be using that same lens in 5 years.
On this basis spend as little as you need on the body and save for the lenses.
Applying this advice to your situation:
IMO the Nikon System is a good choice, especially if you think you might ever want to go pro or hire lenses (Canon is equally good for both of these BTW).
I would not worry too much about the lens choices as there are plenty of good lenses that do work on the D40X - most Nikon Pro lenses are AF-S and will work.
I would ask why do you need the extra 4MP that the D40X has over the D40? If you could be happy with the 6MP D40 you will save a bit of money that you can put towards a good lens. TBH I doubt you'd notice the difference if you only print to A4
Also have you considered a S/H or refubished D70s or D50? These are similar(ish) spec to the D40 and and can be found for about the same price. Both of these have the screw drive AF motor the the D40/D40X doesn't so can be used with a wider range of lenses.