Your landlord doesn't own the building and has no more right to enter your apartment than does a perfect stranger. If he tries to enter your apartment, call the police. You might also want to change the locks.
If the title to the property reverted to the bank the former owner no longer has the authority to enter your premises. You may deny access to the apartment, but, only if the former landlord did in fact lose title to the property.
Mr. Freitas is an attorney licensed in the State of California. The answer provided here is general information and not intended to be specific legal advice. There is not attorney client relationship created by Mr. Freitas' answering any question on this website.
I agree with Attorney Freitas. You can deny the landlord access for the alleged inspection and/maintenance.
In response to your additional information, owners who have been foreclosed upon often assert or claim that the foreclosure was wrongful. However, unless and until a court quiets title and/or cancels the Trustee's Deed Upon Sale (a lawsuit which could take 12 to 24 months), you can assume that the bank is now the owner.
Frank W. Chen has been licensed to practice law in California since 1988. The information presented here is general in nature and is not intended, nor should be construed, as legal advice. This posting does not create any attorney-client relationship with the author. For specific advice about your particular situation, consult your own attorney.