Narrative:

We were level at 22;000 in IMC when ATC cleared us to FL400. As we were climbing through FL230 I heard loud; rapid; snapping sounds. I asked the first officer if he also heard it? He replied that he did. We tried to figure out its cause when I noticed a strong electrical burning smell. I asked him if also could smell it which initially he replied no. Then a resounding yes! He quickly donned his mask while I declared an emergency with an immediate turn back to the airfield. The first officer turned toward the departure airport while I ran the smoke; fire and fumes checklist. The first officer told me that he had momentarily seen smoke coming from the glareshield. At this time the smoke and snapping sound had stopped. And the fumes had dissipated. I called the flight attendants and gave then the emergency landing signal. We continued our precautionary landing with the emergency equipment standing by. We landed and arrived at the gate without further incident.

Google
 

Original NASA ASRS Text

Title: A B737-700 climbing through FL230 developed an electrical burning smell accompanied by a momentary bluish/grey smoke near the windshield; so an emergency was declared and the flight returned to the departure airport.

Narrative: We were level at 22;000 in IMC when ATC cleared us to FL400. As we were climbing through FL230 I heard loud; rapid; snapping sounds. I asked the First Officer if he also heard it? He replied that he did. We tried to figure out its cause when I noticed a strong electrical burning smell. I asked him if also could smell it which initially he replied no. Then a resounding yes! He quickly donned his mask while I declared an emergency with an immediate turn back to the airfield. The First Officer turned toward the departure airport while I ran the Smoke; Fire and Fumes Checklist. The First Officer told me that he had momentarily seen smoke coming from the glareshield. At this time the smoke and snapping sound had stopped. And the fumes had dissipated. I called the flight attendants and gave then the emergency landing signal. We continued our precautionary landing with the emergency equipment standing by. We landed and arrived at the gate without further incident.

Data retrieved from NASA's ASRS site as of July 2013 and automatically converted to unabbreviated mixed upper/lowercase text. This report is for informational purposes with no guarantee of accuracy. See NASA's ASRS site for official report.