If it only works some of the time most likely the problem is the conductive coating on the bottom of the buttons has worn away, this happened to my '06 Chevy Malibu fob. A tiny piece of aluminum foil glued to the bottom of the button was the answer although I have seen posts where people say rubbing from a graphite pencil(!) or 3 coats of conductive paint will work. Or you can buy new buttons. IF you can find someone to sell them to you. Usually you can only buy the whole fob (which you don't need). To test if button conductivity is the problem, take the fob apart but leave the battery in (depending on your fob this may require holding it or taping it) and bridge the pad that you want to test (under where the button you want to test would be) with a small screwdriver blade. If it works when you bridge it with a screwdriver, but not when you press the button, then the button has lost its conductivity.
Mark Jacob
June 2007