Getting the codes is certainly the right answer. Stalling can be from several sources ranging from input leaks, bad CCV, bad MAF, weak fuel pump, clogged fuel filter, bad ICV (if present), bad O2 sensors, and others, and hence the need to get the codes. If you KNOW the service history, that will help, but the real answer, as indicated earlier, is to get the codes.
larrym3711
2001 540iA Sport