As Death2000 said, more info would be helpful, When the engine is hot or cold? Under load or at idle? Does it happen right after you refuel or only when the fuel level is low? Does it roll to a dead stop or just misfire a bit and then take off again?
Most common causes of an e36 cutting out for no apparent reason would be
1. Crank position sensor (or more exactly, the lead to the crank position sensor)
2. Water in fuel tank (try a bottle of HEET)
3. Fuel pump failure. Yesterday I put a post on another forum that involved an e46 but would be applicable to an e36, though e36 fuel pumps are not so prone to failure. Look in the Pelican Parts Forum, e46 section..