94 525i Runs well until you turn on headlights and or fog lights- then stalls. on 1994 BMW 525i

Check engine light comes on and goes off.

Asked by for the 1994 BMW 525i
4 answers
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