Quite of few of my Houston- area bankruptcy clients ask me, "Will I ever be able to buy a house again?". The answer is yes, so long as you wait a while, and get your act back together. It takes a minimum of two years to qualify for conventional mortgage financing, and that is if you can save up a 20% down payment, which many people can't.
Or, if you can save up a 10% down payment, you should be able to get mortgage financing through conventional lenders in as little as 4 years. If you can't even save up 10%, you may find yourself waiting 7 years or longer to get a conventional loan.
But with FHA financing, 3 years is the typical waiting period after a financial meltdown, and it only requires 3.5% down payment. If you qualify for VA financing, it's only two years and there is no down payment required.
After a bankruptcy, foreclosure or short sale, I suggest getting your credit score back as much as possible. My office provides our clients, for free, an educational course called "7 Steps To A 720 Credit Score" which guarantees that, so long as you follow the steps, your credit score will be 720 or higher within 12-24 months. A 720 or higher score will get you the very best interest rates.