Lots of reasons for farting, including celiac sprue, among lots of other causes.
Don't self diagnose; see md, bring a diet
diary annotated with symptoms. You may find the answer simply from the diary; it may or may not be related to grains. May need additional evaluation.