Vomiting baby..

Brianna • 23. Student & mamabear to two handsome boys♡
My son is 2w+3d. He's had no issues with vomiting since being born- spitting up a bit ya, but not full feedings coming up. Hes fed from my milk; but through bottle not breast as it just hasnt worked out. I usually pump in advance for his feedings but last night when I woke up I was surrounded in a pool of my milk and when I tried to pump, not enough came for his feeding so I decided to use formula. He took it well but while burping him the whole thing came back up. The next feeding I was able to pump enough and it went well at first, but maybe 30mins later he puked again- I dont think it was all of it, but most. I'm guessing it was the formula that caused this, but how long will the vomiting last? I checked his temp- and he doesnt have a fever so I know he's not ill. How do I avoid this happening during the next feeding too? I feel so guilty for giving him formula.. :(