Check engine light comes on and goes off.
94 525i Runs well until you turn on headlights and or fog lights- then stalls. on 1994 BMW 525i
have your car checked to see what code is turning the light on
Sounds like alt.problem.
Alternator not providing adequate power to charge battery and operate the vechicles systems.
have codes scanned and ck charging system