The one, most important thing you can do to improve a D40 - or indeed any DSLR, is to switch the focus screen to a split prism one - for a D40 it's about 15 quid from ebay - and makes it (or any DSLR) much nicer to use.
Both my D40 and my D40X are so modified
Both my D40 and my D40X are so modified