Failed speedometer, now what?

I have a 97 Taurus w over 180.000 miles.

My whole misery started a year ago, when going over a hill and driving the car on highway speed the speedometer suddenly failed, rpm went nuts and the car did not accelerate, check engine lights was on. It did not stop though. Took it to Pep Boys, pulled the codes: replaced speedometer gear and speed sensor. Off we went and everything had been fine till recently.

Whole thing started again. Same exact thing. This time I was driving around 20-30 mph when the car just didn`t want to accelerate but was running. RPM was high spite the fact I was driving slow, check engine came on etc. Went to Pep Boyz, declined to run the whole diagnostic since they should be able to find out by pulling the codes what was going on. Told me speed sensor and speed sensor gear. Fixed it. Was fine for couple days, now the issue is back. What the most curious is the fact that the issue is periodically, randomly happens.

I think it is clear at this point that the problem is beyond the guys at Pep Boys. Just because a code points toward a certain component as being problematic, that does not always mean that replacment of that component is called for.

This is where expertise comes into play in order to be able to properly interpret trouble codes and to do some trouble-shooting to find out the actual source of the problem. Ask friends and neighbors for recommendations on a competent independent mechanic in your area.

Gear driven speedometers have more than one gear. If replacing the outer -driven- gear is not working out then it could be the inner -drive- gear, also plastic. Yet, on this taurus, that gear is on a vertical shaft which reaches down into the transmission and, on the tip of that shaft, is yet another gear.
All of this needs checked out by a better tech than pee-boys, possibly a transmission shop.