My car wont go forward or in reverse but its running fine the problem just occured on 2006 Buick LaCrosse

The problem justed occured when i put the car in drive or reverse the car wont go anywhere if i shut it off and turned it back on it will reverse and go foward for a minute and go back to not working

Asked by for the 2006 Buick LaCrosse
That's a issue with the transmission sounds like a bad solenoid but take it and have it checked