Check to make sure you are using the correct water temperature (at least 120 degrees Fahrenheit). Use the correct amount of detergent. Load dishes properly. Use a rinse agent. Occasionally run a vinegar clean-out to remove hard water filming. Pour two cups of vinegar in a bowl, place in bottom rack of the dishwasher and run dishwasher through wash cycle without detergent. Do not complete the drying portion of the cycle.
Glasses or dishes with spots or film can remain in the dishwasher; however, all metal items must be removed. The acid in the vinegar can harm the metal. Dispenser cup malfunctioning and/or a change in the water supply can also cause spots/film.