Again, they're both great choices. Something to consider, IMO, you will most likely reacquire (get back on) your target more quickly with the 9mm over the 40. That said, there are PLENTY of others here, including myself at times, that carry 40's and 45's routinely.
The bottom line is, whatever you get... practice, practice, practice!