Civic and a problem with hazard switch

My '99 Civic failed inspection today because the hazard light switch is acting strangely.



If the car is off then you have to hold the button in to make the lights flash. If the car is on then the button works fine (you push it once and the lights stay on/ push again and they turn off). The turn signals work just fine.



They want $72 at the dealer to replace the switch. The fact that it works sometimes makes me think the switch is ok. I guess I am reluctant to pay $72 for this. I worry that there is something else wrong. Why would it work when the car is on but not off? Something about it still works right. Do you think that replacing the switch is necessary and will fix the problem?



Thanks!

Something tells me it’s just a dirty switch. I fixed them over the years with a shot of WD-40. Take some paper towels or rag, (hold it under to catch the drips) spray the red skinny straw way up into or down into the switch and then work the switch several times. It might just fix your problem.