like when u turn the ignition to start the engine would run but when you let the key go it shuts?
try holding it @ the start position (not for long, like 10 secs) and let it go extremely slowly, until it reaches "on" position.
if the motor dies w/ the starter, then i'm not sure what it could be, but if it dies a little bit after the starter goes out and your still letting the key go, then its your ignition.
same thing happened in my brother's car, it took me a while while to figure out.