Hello and welcome to Just Answer. Have you had the codes checked? If so do you remember what codes were present?
Alot of auto parts stores will retrieve the codes for you at no charge. If you can get the codes I can try to help you diagnose it better. Without the codes it is only a guess. The codes will point you in the direction of the faulty part that is causing this.