I would try to find a D50 instead, or better yet, a closeout or used D70/D70s. The 40 does not have an AF motor in the body, so you can only use AF-S lenses with the silent-wave motor in the lens body.
I've not done really any shooting with the 40 or 50, but I've shot with the 70 a fair amount and own the D200. I've shot Nikon film for years and have had the 200 for a year and a half. I personally prefer the slightly bigger body on the D70 over the small bodies of the 40 and 50. They feel better in the hand.
If you want to do any manual exposure stuff, the 70 has two command dials (one for aperture and one for shutter speed). The 40 and 50 both have only one command dial, and a button to toggle it between aperture and shutter speed.
Unless you plan on printing bigger than 16X20 and plan on buying pro glass ($1000+ per lens for zooms) the 6.1 MP sensor in the D40, 50, and 70 will be plenty. That sensor will outresolve most of the inexpensive consumer zooms on the market. There are some exceptions. The 18-70DX when stopped down is VERY sharp, as are the primes. The 50mm f/1.8 is one of the sharpest lenses you can buy at any price, and it's only about $120.
Sorry for the long answer to a short question. If you would like more info, I can tell you more than any reasonable person would want to know about the Nikon lineup.
One last note, GO TO A CAMERA STORE. Not necessarily to talk to the folks behind the counter (there are some who are very good, but I've met some who are awful). Go so that you can feel the camera in your hands. Take a few shots with the D40 or 50, then with a D70, then with a Rebel, and a 10D or 20D or whatever Canon's current equivalent is. Some people have Canon hands, but almost everyone I've met who isn't already shooting a Canon SLR says that the Nikon's feel better and more natural in the hand.