Check your battery. I had a 99 Dakota that did the same thing, turns out it the battery had some dead cells and was killing the PCM's learned idle information.
I didn't believe it because the truck started OK, but they tested the battery and it was toast. New battery solved the problem.