Though the 1D is certainly a capable camera, it's pretty much a 1Dinosaur these days. I use to own one, and it was a great camera, but things have certainly changed and there are many things the 40D can do that the 1D simply cannot because of the difference in resolution. Again, I'm not bashing the 1D at all -- I use to own one and I paid about 5k for it, but it is getting a bit antiquated.
There is a certain place where an old camera is no longer functional, and for everyone it is a different place. For me, the 1D2 and 20D were the turning point. I think there is a bigger difference between the 10D and 20D, than between 20D and the 50D.
I love my 1D2, even with the small screen, lack of joystick, not having the RAW/JPG split for backup, etc. The 1D, however, is just too old to be practical. The 40D is a fine camera, I used one for about two years.
If you can fine a 1D2 get it, if not then get the 40D. I take it back, save for a few more months and get the 1D2 anyway!
I had the 40D, and sold it when I bought a 1D and 1Ds. I would say the 40D and 1D are almost equivalent for me personally. The 40D was a great all-around camera. The 1D has stronger positives (build, focus, shutter) balanced out by its stronger negatives (buffer, battery, screen, menu, sensor). However, if I didn't have the 1Ds, then I would personally rather have the 40D.