While researching something else, I stumbled across this list of common medications that can impair memory functions. In some cases, like narcotics, it happens because of a general fuzzing effect -- anything that lowers your state of alertness tends to make memory tasks harder. That's a side effect, so sometimes it can be gotten around. Others are mechanical, like antihistamines that inhibit acetylcholine -- anything that suppresses the function of a biochemical element of memory tends to make memory worse. That's a direct effect which is a pain in the ass; you can't avoid it with any drug which acts on that aspect of biochemistry. Short-term use has less impact, whereas long-term use tends to compound over time. If you need medication that can impair memory, try to make it as-needed or short-term rather than ongoing maintenance meds. Warning labels on some are being updated to warn of memory impairment, so watch for that, and if you see it then ask if there's a different drug without that problem.