Abstract: We study the effect of spatially periodic magnetic field on the transport in a two-dimensional electron gas in GaAs/AlGaAs heterojunctions. The magnetoresistance curve contains an oscillatory component due to the magnetic modulation as well as one due to the electric potential modulation, and their relative amplitudes can be varied by adjusting the gate bias or the maximum field or field cycling.