To control barn flies feed all the livestock and pets natural diatomaceous earth at 2% of the volume of their food daily and hang clear bags of water from the ceiling and rafters.The bags must be replaces after they get real dusty.The final step is to release beneficial fly parasites in the manure areas.