I have the non APO version of this lens on my D40X. It works, but you can only manual focus. For me this wasn't a problem as I prefer to manual focus.
Also if your planning to use this lens as a macro lens, I think you will be dissapointed. The macro option is only available between 200-300mm and its not good at focusing very close at all.
Its a decent telephoto lens for the price though. All that has been said about the non APO lens though. I know for a fact that the APO one will work on a D40X as I tried it out in Jessops. All works apart from the autofocus. You will have to focus the lens manually.