Q: What does an on-access scan do.
A: Scans files that may or may not be active.
Q: how does inactive malware get on to your system.
A: something has to download it, etc. and at that point, guess what the on-access scanner/s (web shield/p2p shield/standard shield, etc. scans newly downloaded/created/modified files.
So from the above (a brief how avast works), I hope you can now answer your own question