We found a product Vermin X at Costco that you plug into an outlet. It's supposed to repell insects. We have found it to work fairly well for crawling bugs, but don't know why it wouldn't work for flying ones. Good Luck
We used one of the "Wasp Catchers" that you can find at Lowe's in the garden center. It looks like a large jar and has white tubes in it. We hung it on a corner of our porch for the wasps, but found it also caught the flies. We found the best bait was honey dribbled into the jar and on the tubes, and about 2-3 cups of very warm water poured into the bottom of the jar to get the honey melted into a nectar. You may also want to see if you have or had an area with some garbage or decaying something or other that created lots of maggots. Washing out your trash cans my help.