I have bad posture. The past few weeks I have been forcing myself to sit, stand and walk straight. Can this cause neck ache, headaches etc?

Could be. Anytime, you try to change longstanding postural bad habits, your body may rebel a little at first with some increase in pain or discomfort. However, it is never a bad idea to pay attention to good posture since your whole body will eventually function much better. Eventually your body will prefer your better posture.