I was just about to post a link to Ken Rockwell's site; it's really an amazing site and he's got great reviews and advice. He was an engineer with basically more money than he knows what to do with so he's put his efforts into reviewing camera gear for merit, not price tag. In the end, he's absolutely right: you can take good pictures with any
camera; it's just easier with certain equipment.
SO and I have a Nikon D70 which is comparable to the D40 that you're looking at. Ours has a few more features that you're probably not interested in and the D40 is more compact, which most people like. Also, the lens that comes on the D40 is actually a really good lens; maybe even better than the one that comes on the D70. We haven't invested in a different lens and are perfectly happy with the one we have. Maybe someday we'll be able to afford a macro lens, though.
However, we did invest in a nice flash and a few filters for fun, too. SO recommends a UV filter to protect your lens.
Good luck making your decision!
ETA: Here's a link
to my fotki with a few pictures taken with the D70. The first two have been finagled with in Photoshop, but the last two are straight-out-of-camera.