Well, the code is already in AX, so you can see it there. How to find the problem? Review your setup and if it doesn’t help, debug the code. There you’ll see why it doesn’t do what you wanted it to do.
Also, if you’re getting any errors, it might be useful to mention it here. So far we know only that it “doesn’t work”.