Unfortunately, we’re not able to give you the best controls without knowing the exact pest. Some flies are just nuisance flies that don’t harm the plants (some might feed on decaying plant matter, such as in soil or mulch); others, such as the metallic green/gold long-legged fly, are beneficials that hover around plants because they are seeking other insects as prey (for the long-legged fly, that includes aphids, gnats, mites, etc.). Still others are actual pests of the plant. Although yellow sticky traps are more for monitoring pest populations, if you have a small crop, you might try hanging a few around your plants to see if they trap these pests (if they are attracted to yellow). This may also, however, trap beneficials. To deter flies in general, it may help to clear out any decaying plant debris, old mulch, and weeds around your plants. Hope this helps!
Unfortunately, we’re not able to give you the best controls without knowing the exact pest. Some flies are just nuisance flies that don’t harm the plants (some might feed on decaying plant matter, such as in soil or mulch); others, such as the metallic green/gold long-legged fly, are beneficials that hover around plants because they are seeking other insects as prey (for the long-legged fly, that includes aphids, gnats, mites, etc.). Still others are actual pests of the plant. Although yellow sticky traps are more for monitoring pest populations, if you have a small crop, you might try hanging a few around your plants to see if they trap these pests (if they are attracted to yellow). This may also, however, trap beneficials. To deter flies in general, it may help to clear out any decaying plant debris, old mulch, and weeds around your plants. Hope this helps!