Hi,
Have you mentioned this to a doctor yet? They may be able to run tests that could help. Especially cognitive ones. And Catherine's b12 suggestion is excellent.
What you describe is far more severe than anything I have seen or experienced. So you may be describing something completely different. But here are the two experiences I've had with memory weirdness.
I have discovered that if I eat soya (e.g. A protein shake) my mind goes completely wooly. I can't remember the simplest things. It is like my short term memory wipes itself - for a couple of hours. I can still function, drive, etc. I just struggle to remember it. Needless to say I now avoid soya as much as poss! And try not to operate machinery if it happens!
Also, my father was starting what we thought might be Alzheimer's (he was 82 at the time). He had become vague, absent minded, slow thinking, slow reaction times. He took forever to answer questions, and was then usually careless about the decision.
Turns out he had become type 2 diabetic, and his brain fog dramatically cleared once he brought his blood glucose down.
I've no idea if either of those are relevant to your situation, but I really feel for you. In both the situations I've described, it was both bewildering and very worrying.
Do you have a blood testing meter? And can you test your husband's blood glucose when this behaviour happens? I'm thinking that another possibility might be he is having a hypo.
Hope someone else comes along with a suggestion that helps.