Call the local water department to determine the water hardness in your city. Generally, they will be able to inform you if the water is soft, average or hard.
Read the directions to determine how much dishwasher detergent is necessary for your water hardness. Use a quality dishwasher detergent, and follow the manufacturer's directions. Many of these manufacturers state that their products have an additive that reduces hard water spots. Gauge the detergent with measuring spoons rather than just guessing when you fill the dispensers. Using a gel pack or tablet may be convenient, but it does not allow you to increase or decrease the detergent as necessary to reduce water spots.
Pour a rinse agent into the dispenser of your dishwasher, and use the amount indicated on the label for your water hardness. These also come in tablet form that you can hang on the rack if you don't have a rinse agent dispenser. Another option is to add one-quarter cup of white distilled vinegar to the dispenser or during the rinse cycle. These rinse agents enable the water to run off the dishes in sheets, thus reducing hard water spots.