Go with the D40, the sensor is very good and operation is simple. 95% of the images I have posted in the past were made with a D40. It's more about the lens than the camera body. As for the AF aspect of lens, I shoot most of my images in manual but the future of photography is going almost total digital. Might as well make the switch now IMO.
The d40 is an awesome camera and you'll find that you can take some incredible images and then upgrade the lens as you need