What causes sudden stomach pain and gas! Sometimes I would have a bowel movement but other times I wouldn't.

How long? A viral illness and/or food poisoning are probably the most common causes of those symptoms but that usually moves thru your system in a few days. If this has been going on longer than that you should see an md for a work up. There are inflammatory colitises, food intolerances, parasitic diseases and other diseases that may cause the same symptoms but over a prolonged period.
There are many. possible causes for the symptoms you are expressing but it is most likely related to something you ate. Either you have a food allergy or an intolerance. It is possible that you have eaten tainted food. In general this is not something to be too worried about but a thorough evaluation by a health care professional would set your mind at ease. Make an appointment for this.

Related Questions

After eating I had gas and stomach pains and an urge to poop. It was normal but now I have stomach cramps and frequent bowel movements. Why?

More info? The first thing one thinks of is gallbladder but more info is needed. How long does it last? Anything make it better? Anything make it worse? Does it radiate to your back? Or shoulder? Have you had any surgery ? How long has it been there? Have you tried any medications? Did they work? Did you injure yourself? Pulled muscle etc? Has anyone done any studies? Cough? Fevers? Read more...