If there is concern about lactose intolerance or milk allergy, then switching back and forth amongst the various formulas would not be a good idea. Almost all of the milk-based formulas contain lactose (there is one lactose-free milk formula), while the soy formulas don't. The carbohydrate in the soy formulas is sucrose and/or corn syrup. Infants who have lactose intolerance often move to a soy-based formula.
Infants who have milk protein allergy have to switch to either a soy formula or an elemental formula such as Nutramigen or Alimentum. The elemental formulas contain milk proteins that have already been broken down into smaller amino acids, which then do not stimulate an allergic response in the baby.
Most babies do not need elemental formulas though, which is good since they are much more expensive than the milk- or soy-based formulas. Some babies who are allergic to milk are also allergic to soy, which is why the move to an elemental formula may be necessary, but most babies who have milk protein allergy can take soy formulas without a problem.