It has been suggested that electrostatic mechanisms may contribute to several phenomena observed on the lunar surface, including the formation of lunar swirls associated with crustal magnetic anomalies. Uncovering the mechanisms behind electrostatic charging and lofting has been a long-standing problem. Recently, the patched charge model, developed from advanced laboratory experiments, has significantly increased our understanding of this problem. In this paper, we present laboratory results which demonstrate how electrostatic dust lofting is controlled by surface magnetic fields. These results will help explain dust activity in lunar swirl regions. Dust particles are charged and lofted due to exposure from a UV light in the laboratory, and magnetic fields are created using permanent magnets. It is shown that the presence of magnetic fields decreases the overall level of dust activity, and that the extent of the decrease depends on the orientation of the magnetic field. However, the Lorentz force is too small to change the motion of these charged dust particles due to their large mass, and photons are not affected by the magnetic field. While the exact mechanism is still not fully understood, we suggest a theory which postulates that the orientation and strength of the magnetic field control the mobility of photoelectrons. This affects dust charging processes, described in the Patched Charge Model, and the subsequent level of dust activity. A computer simulation is developed to examine this theory and compare with the laboratory observations.