Caulk or plug any openings. Ventilation holes can be a way for flies to enter a building. Ventilation is important to maintaining adequate air circulation within the building, but screening must be used to exclude flies. A fly swatter is an economical control method for the occasional fly. Most space sprays contain pyrethrins for quick knockdown.
Aerosols give temporary relief, however.
If you have many flies inside, you would be wise to find out why they are there and take steps to relieve the problem through sanitation and exclusion.