Well, I think what may be happening is that with myopia (nearsightedness), you see close up things fine, but distant objects are a bit blurred. Your new glasses are really designed to correct that particular problem. So if you use them for all seeing, far and near, that may be what is causing the headaches, as your eyes don't need them for all occasions.
Myopia works like this: After doing prolonged close work, the focusing muscle inside the eye locks up into a state of near focus. Over time this leads to permanent nearsightedness, an abnormal lengthening of the eye.
So to sum up, distance glasses are not for close work, only for distance viewing. Use them only when and where you have difficulty seeing and your headaches should disappear.