Repair Lamp with intermittent problem
Most likely your switch is going bad or it is at the switch, but I do agree with @Martin Bonner and think if it's not that it's a loose connection. These are not that hard to find. It's the loose connection.

Good luck.