Ok, a little more fiddling around and I discovered the problem. My database was corrupt. Repairing it fixed the problem. To think I’ve been pulling my hair out for 3 days and all I had to do was repair the database…..
I’ll leave this posted just in case others have the same problem.