If instead of opting for a short sale you allow the property to go to foreclosure, whether by deed-in-lieu or actual foreclosure, it will probably appear on your credit report for 6 or 7 years.
There are different types of bankruptcies. I have a client that filed in 2009 and will be eligible to purchase another house by 2013 (4 years). Because this is a legal question and we are forbidden from giving legal advice, in all cases I recommend consulting a real estate attorney.
Green Home Realty