What is your spectacle prescription and where did u get it checked? If it was done by a eye specialist, then it should generally be OK. There are commonly two things that we look for in a patient like you -
1. If you are straining too much when the glasses are being checked. This is called excessive accomodation and is not always something that you can influence. Pls talk to your doctor about something called cycloplegic refraction
, if he feels the need. Beware that post cycloplecic refraction your vision will remain blurred for about a day or two after which it should be fine.
2. It may be migraine headaches
to the eyes. This needs treatment with a general physician.
Hope this helps with your problem and the headaches disappear soon.