There are specific questions on the 4473 Form that, if answered honestly, would prohibit a medical marijuana patient from purchasing a gun. The form even has this warning:
“Warning: The use or possession of marijuana remains unlawful under Federal law regardless of whether it has been legalized or decriminalized for medicinal or recreational purposes in the state where you reside.”
So if the gun seller knows that you are a medical marijuana patient, they would be in their right to deny selling you a gun.
It has been reported that some police departments in Pennsylvania, Illinois, and Hawaii have taken it upon themselves to enforce federal law over state law by informing medical marijuana patients they must either turn in or dispose of their guns.