Both/either! The caliber discussion has gone on for years, and will never have a clear answer. The truth is that with modern ammunition, both will get the job done, but neither is anywhere close to perfect.
Consider the ammunition cost. Depending on where you shop, you can still find 9mm ammunition for $10/50. You probably won't find it for the .40 for less than $15/50. So if you plan to shoot a lot, 9mm is definitely cheaper.
As for myself, I carry a Glock 23, which is chambered in .40. However, I also reload my ammunition, so cost difference is negligible.
So, see if you can rent or borrow these guns, shoot them, and see what you like, while considering ammo cost, and remember that practice is a necessity! Also, search here on OKShooters - this topic has been covered ad nauseum!
You didn't put an option for both! I've always used the 9mm but I shot a G23 the other day, first time using .40, and I really enjoyed it, but if choosing one I'd stick with my 9mm just based on ammo cost.