Good Morning ~
I need to know if this part keeps the water from filling the machine when the lid is opened?
Answer Donna, the lid switch cam, activates the lid switch plunger and switch. It is a "secondary" circuit, as far as the fill cycle is concerned.
We don't know the exact circumstances, but you most likely need to lid switch assembly 22003804 based on your post information. Good Luck.