On my 1999 Dodge Ram, when accelerating with the A/C on, the air stops coming out the vent and comes out the defrost. When I lift off the gas, it comes out the vents again. This happens when both A/C or non-A/C vent is on. Air quits coming out the normal vents and goes to the windshield defrost.
Sounds like a vacuum leak within the mode switch.
This is a familiar problem with Rams. The setting is controlled by engine vacuum. Acceleration increases the vacuum and the the airflow setting changes by itself, temporarily.
Dodge has a TSB and a fix for this situation. It consists of installing a valve in the vacuum line somewhere. You’ll have to consult your dealer. Or you can consider this a minor nuisance and just live with it.
There is a one-way check valve on the vacuum line from your engine to the climate controls. Either that valve has failed, or you have a vacuum leak somewhere in the climate control system. The air doors in your truck are vacuum controlled. Defrost is the default position if all vacuum fails.
As SteveF says, this is a common problem on Dodge Rams of that vintage. I have the same problem with a '99 Ram Van. In researching this on the Internet I found there is an improved check valve/accumulator that costs less than $10. I still haven’t gotten one, but that’s because I don’t use the van very much and it’s not a big deal.
I remember that one from back in the 1960’s You have a vacuum problem, likely a leak