The effect of a magnetic field on the charge stripe order in La(2-x)Ba(x)CuO(4) has been studied by means of high energy (100 keV) x-ray diffraction for charge carrier concentrations ranging from strongly underdoped to optimally doped. We find that charge stripe order can be significantly enhanced by a magnetic field applied along the c-axis, but only at temperatures and dopings where it coexists with bulk superconductivity at zero field. The field also increases stripe correlations between the planes, which can result in an enhanced frustration of the interlayer Josephson coupling. Close to the famous x=1/8 compound, where zero field stripe order is pronounced and bulk superconductivity is suppressed, charge stripe order is independent of a magnetic field. The results imply that static stripe order and three-dimensionally coherent superconductivity are competing ground states.