I'm surprised he didn't offer you a prescription and say 'here, try this'. (sarcasm) Drives me crazy that doctors do not try to figure out what's wrong as a 4-month old's digestive system is not ready to handle solids yet.
How about trying a formula that does not have dairy or soy in it. Your daughter could be experiencing allergies already which means that you need to be aware of the vaccines as they contain ingredients that have either caused the food allergy or could make the reaction to the shot worse. I have some of the shots broken down by ingredients with the food allergies that my daughter has and at our last well kid checkup, I shared it with her doctor after the doctor said she needed three of the shots that contained these ingredients. The doctor knows of my daughters food allergies but was not aware of the vaccine danger and asked to keep the list.
Please make sure YOU have done the research on vaccinations for YOUR child. The AAP recommended schedule of shots for children is too many, too soon. Here are sites and books that I always recommend for people to start their research:
www.909shot.com
www.tacanow.org
Healing the New Childhood Epidemics: Autism, ADHD, Asthma, and Allergies: The Groundbreaking Program for the 4-A Disorders, by Dr. Kenneth Bock
The Vaccine Book, by Dr. Robert Sears
What Your Doctor May Not Tell You About Childhood Vaccinations, by Dr. Stephanie Cave
Evidence of Harm, by David Kirby