Crabs need a specialised tank, with access to land and brackish water. Should be 2/3 land, 1/3 water. If you try to keep them fully in the water they'll constantly try to climb out, as stated.
shrimpandcrabsandcrayfish.co.uk has some good info, as well as pictures of different ways to set up a crab tank.