What can cause sudden onset of short and long term memory loss and confusion in the elderly?

Many things. A large number of things including illnesses, medications (including nonprescription medications) and other things can cause this. Anyone who experiences a sudden onset of a major symptom effecting the brain should see their doctor as soon as possible. Delirium is one of the most common and serious illnesses that can cause this in older adults.
Small blood clots . As we get older we notice that we tend to forget things and it gets more difficult to do some of the things that we used to do. Much of this is a natural aging process but is caused by the lack of blood and oxygen to various parts of the brain. Very small blood clots and pieces of cholesterol plaques make their way to the brain and cut off the blood supply in very small vessels. More....
Drug effects/toxins. Sudden onset is unusual & of great concern. The most commonly prescribed drugs in the elderly, statins, have been found to cause this exact side effect, though it is usually transient. See http://www.Spacedoc.Com/662_cases_memory_loss for more info. Other medicines could cause this, such as sleeping pills & tranquilizers. Acute toxicity with heavy metals/molds could cause but is less likely.