Try a 'hard re-set' of control modules by disconnecting the battery cables and touching them together for a minute. Then re-connect and test drive. IF symptom changes , the problem is likely electrical , not mechanical in nature. Could be a bad 'pin' connection (contact) at the TCM or elsewhwere. What kind of maint. or repairs done recently(past 6 months?).
Went to AAMCO in Englishtown, NJ, he said I needed a rebuilt transmission. $2500.00 Then, took it to Gibraltar on Cranbury Rd. in East Brunswick, NJ... He said I needed a Solenoid $500.00! I said OK! Job is done tranny is like new! Thank God and Steve at Gibraltar. I found that our AAmco(only 1 mile from my house) is known to take advantage of anyone that walks in the door.