We present a comprehensive neutron-diffraction study of the magnetic structures of ErNi 2 B 2 C in the presence of a magnetic field applied along ͓010͔, ͓110͔, or ͓001͔. In zero field, the antiferromagnetic structure is transversely polarized with QϷ0.55a* and the moments along the b direction. At the lowest temperatures, the modulation is close to a square wave, and transitions of Q between different commensurable values are observed when varying the field. The commensurable structures are analyzed in terms of a detailed mean-field model. Experimentally, the minority domain shows no hysteresis and stays stable up to a field close to the upper critical field of superconductivity, when the field is applied along ͓010͔. Except for this possible effect, the influences of the superconducting electrons on the magnetic structures are not directly visible. Another peculiarity is that Q rotates by a small, but clearly detectable, angle of about 0.5°away from the ͓100͔ and the field direction, when the field is applied along ͓110͔ and is approximately equal to or larger than the upper critical field.