I've been developing a simple db and recently wrote OnLoad and OnUnload subs for the main (and only) form. When I test during a session, including closing the entire db and restarting, everything works fine. But if I close down Access (2010) itself, then start it up, open the db and open the form, the debugger opens with yellow marker on an assignment statement near the beginning of the OnLoad code. It's as if there's a breakpoint there. But I've cleared all breakpoints. There's no error message, audible or visible! If I continue out of the code, the form comes up normally, and if I close it and reopen, it behaves normally. The problem only occurs once and only after opening Access itself.
Seems like there's some environmental factor with a glitch. I've tried Compact and Repair with no effect. In VBA, the compile option is greyed out. Why would that be?
Any help appreciated.
-Ron
EDIT - OK, I simply untabbed that line of code, moved it a bit, saved closed and problem gone. What the....?! I had tried decompiling, but that in itself didn't help. And even now, the compile menu option in VBA is greyed out.