I have used calcium tablets to counteract loose stools caused by IBS. You need to get the 600mg Calcium plus Vitamin D3. Half a tablet after meals, three times a day. It should help reduce the acidity as well as firming things up.
You could also try a probiotic containing Saccharomyces Boullardii. [look on google!]
Either one or the other, or sometimes both together.
Looking at diet, reduce cereal fibre, gluten and foods containing excess fructose, as these all promote loose stools and faster transit times through the colon.
It is worth looking at the Low FODMAP diet.
All the best.