The correct word to use in the sentence is "effect."
So the complete sentence would be: "What effect did the medicine have on you?"
"Effect" is a noun meaning a change that has occurred as a result of something. "Affect" is typically used as a verb meaning to influence something.