If you already own a 9mm I would go with the .40.
Otherwise get the 9--cheaper ammo, faster cycling rate, faster volume of fire, less recoil and less wear and tear on the pistol.
As others have pointed out,ammo has improved the stopping power of the 9mm.
I'd go with Speer Gold Dot or Critical Defense carry ammo.