I really really feel for you. We have a beagle too, and it took forever to train her. Fortunatley for us, we live in the country and I can let her out to run. She always comes home but can burn off energy.
Once I was able to leave her outside for longer periods of time, she finally didn't pee in the house anymore.