It used to be said that where there are spiders in the house, the indoor climate is very good.
I always have a spider in the house and flies in the attic as well. Not noticeably many now, but you do find some dead ones on the floor from time to time.
Starting in early summer, we also have flies in the house, which is certainly due to the agriculture in the surrounding area. Around mid-May, about 20 cattle graze in the neighbor’s garden. My chickens are free-ranging anyway, and farther away there are pigs.
I think you have to live with that. At least in the countryside. Fly screens only help to a limited extent.
If there are too many flies, just buy one can of insect spray and spray it into the attic. It takes 5 minutes and the flies are dead.