The accuracy problem isn't due to the gun. It's due to your technique.
A decent revolver (i.e., S&W J-frame) with a 2" barrel can make accurate hits out to 50 yards, in skilled and practiced hands.
The key word here is practice. It will also help if you could find a good instructor, who can teach you revolver technique.
Switching to a semi-auto pistol will make very little difference. You will still have to learn trigger control, in order to make useful hits. You will still have to practice.
Switching guns will not solve the problem.
Getting some really good instruction, and then doing a lot of practice, will help a whole lot.