In almost all of my apps I put a function setButtons() where I enable/disable all kinds of controls.
After every action, like inserting records, opening files, closing files, editing fields or making coffee etc, I call setButtons() to put every control in a valid state. Once used to this approach, you'll never have to think about how to keep things in sync again.