It should not if you surrender the home while in bankruptcy and if you file for bankruptcy before the foreclosure process is complete. Keep in mind that future creditors will be looking at what you did after the bankruptcy filing, not before when making any decisions regarding whether to extend credit.
Depends...have they already started foreclosure proceedings. If so, then it depends how far along in the proceedings they are.
They may lift the stay in the bankruptcy to finish the proceedings and then you get both.
If they haven't started and you file bankruptcy, then you may be able to complete the bankruptcy before the foreclosure and just have the bankruptcy.
Good luck with your situation.