Why these two models?
What type of photos (and in what conditions) do you think you'll use a camera in more often?
What type of 35mm SLR did you use, and do you still have any lenses for it?
What's your budget?
These are very different camera models, and you'd need to consider what lenses you need with a D40 solution (if you want the zoom range you'd have with the Panansonic).
Of course, nothing says you have to buy everything at once, and you could always start with a kit lens, using it for a while before deciding if you need something more (and you'd be able to make a better informed decision after understanding the strengths and weaknesses of a single kit lens).