Ok, I have recently found out (after experiencing this problem myself) that it helps enormously if we start off in a position where I get lots of stimulation... Stay away from woman on top positions and go for the guy's favourite position. That way you keep the excitement level high untill he settles down. It's worked for me twice in a row now in situations where I started losing my erection. I've gone from only barely hard enough to have intercourse to a raging horn in 10 seconds flat using this technique
In addition, giving positive feedback is great, but if the guy is nervous about his performance it won't do the trick alone... If he starts to lose it go down on him till he regains his erection and get him back in the saddle as soon as possible. If your partner is willing to watch for a while double up on him with the other girl untill he has a roaring erection, then go for a nicely stimulating position...
On another thread it was suggested that you swop back to your own partner, I wholly agree, this is the best way to calm nerves and help him regain some confidence.
I read somewhere that erections are based on a balance of emotions. The more positive emotions you experience the better your chance of getting one, and the more negative emotions, well, you go down south...
Lastly, there is nothing wrong with you if this happens, I would suggest trying again with a specific couple if it didn't work out the first time, but if he strikes out twice I'd certainly drop them. Mention to him to try a minimum dose of Viagra after the first time, it'll do his confidence a whole lotta good and soon he won't need it again...