Hello and thank you for asking your question on just answer. My name isXXXXX will try to help.
Is he straining to have a bowel movement and nothing is coming out?
How many times has he vomited today?
Can he keep water down?
Did he have any new foods, new treats, or get into the trash?
Do you see any spots of diarrhea or does he have access to the yard while you are at work?
Sometimes they strain to have a bowel movement when they are constipated.
Other times it is because they have diarrhea with colon inflammation and they have the urge to go even when the bowels are empty.
To help settle his stomach, you can give him 1/4 of a human 10 mg pepcid tablet every 8 hours. It reduces stomach acid.
Do not give him any food, or water, for the next 3-4 hours to make sure he is done vomiting. Then you can gradually offer water. Once he is doing well with the water, you can offer him small mounts of plain cooked chicken and rice or his regular food.
I would buy some plain metamucil. Mix a teaspoon of the metamucil with the favorite food once a day.
There is also an over the counter product for hairballs called "laxatone." It does help prevent, and resolve, hairballs but it can also help with constipation. Try 1/2 inch to 1 inch strip once a day. You can buy it at any pet store.
If your dog will eat it, you can also try canned plain pumpkin. It is high in fiber. Give a tablespoon of that once a day with food.
You can purchase a stool softener at the drug store called "docusate sodium." You can give 50 mg by mouth per day as needed.
You can also mix a spoonful of mineral oil into his food. But do not use mineral oil if he is vomiting because he could aspirate it into his lungs.
I do not recommend trying to do an enema yourself at home. It can be dangerous for your dog.
If these remedies do not work, there is a veterinary prescription medication called "lactulose." This is a liquid that is given 2-3 times a day by mouth for constipation. It is quite effective.
There are also foods called "low residue." These are foods that are more digestible which means there is less stool to come out. "Iams low residue" is a popular one.
Try to encourage water intake as well. The more water he drinks, the less likely he will have hard stools. You can add water to his food or a little low sodium chicken broth. Canned food has a higher moisture content then dry food. If he is not used to canned food, change him over very gradually or she will get diarrhea.
I hope this helps.