There are over 100,000 species of flies in the world. The common house fly is categorized as a filth fly because they breed in garbage, rotten food and manure. From egg to adult may only take 10 days. Many generations of flys will be produced in a short span of time.
Control is therefore ongoing.
Keep trash cans and dumpsters clean with the lids closed. Move dumpsters as far away from your house or business as possible. Keep pet manure picked up. These steps will eliminate their breeding sources. Seal any cracks around doors and windows where flies are entering.