my quest sputters and cuts off after reaching temp. on 1994 Nissan Quest

runs great when cold. after comming to norm temp begins to miss appears to be elect. at worst state the tac will lock on 1000 rpm at idle and will lock on 40000 rpm when i touch gas ped willhold 4000 rpm regardless of motor speed until it returns to 1000 rpm at idle

Asked by for the 1994 Nissan Quest
seek diag and est and have codes read