Switching sides with partner in doubles

In a match, if I start out on the deuce side, when can I change places with my partner and play the ad side? Sometimes I play with 'more experienced partners' and find out that I am the better player and they are losing points on the Ad side. Rule somewhere in the code?