When to go to the ER for dehydration..

I don't want to go to the ER, but I'm starting to think I need to. I've been throwing up and nauseous since 9pm last night. Not able to keep anything down. Also last night I had diarrhea (sorry TMI). I can't keep anything down except Frosted Flakes I've been snacking on for a couple hours. Every time I drink Sprite or water, I get sick. Throwing up yellow foamy bile. I was prescribed Phenergan, but it's not working anymore.