First off try a different USB cable, just to make sure that the problem is not created by the cable and do not use the indication that the tablet is changing as a sign that the cable is not at fault.
Next power off the tablet and connect it to your computer by the USB cable, then power on the tablet, which forces the computer to recognize the tablet as a new device. If you are still not successful, open device manager on your computer and and check for any device with a red X, if so right click on the device and remove it. Then unplug the USB cable and reconnect. If you remain unsuccessful, have your tablet connected to the computer and swipe down from the top left of the tablet screen and see if you have an option for USB connection type and change it to PTP.
Keep us posted on your progress.
Sent from my Nexus 7 using Tapatalk