Life happens, doesn't it? A foreclosure in and of itself will not permanently keep you from buying a home again! What is important is what you do after the foreclosure. After the foreclosure you need to make certain that you re-establish your solid credit history. To do this make sure that you have open lines of credit, use them wisely and pay all bills on time every time. A mortgage lender will want to see what your history has been since the foreclosure. Also, take some time now to write a letter to explain why you allowed your home to go into foreclosure, a lender will need a letter explaining this and it will be easier to write it now then to dredge it up when you are ready to buy in the future! Best of Luck to you!
If you are straight forward and are obviously trying to correct your situation, some lenders will be more understanding than others. A gret deal depends on your openness and how well you present your case.
Find a Realtor who understands your situation and is willing to assist you in finding the right property for you to use as a base for re-building your credit.