A landlord can only enter your apartment or home without 24 hours notice if there is an emergency such as flooding or other damage that needs fixed.
For other non emergency situations or repairs the landlord must give you 24 hours notice in advance before they enter your home when you're not there.
Landlords cannot just enter your apartment or home whenever they please when you're not home. That is unless it's an emergency.