I've run into a weird one. I have a form that had NO controls that could take focus. All was controlled from the ribbon, and the form only displayed things in response to procedures called from the ribbon. Recently, I tried an experiment, and add a few controls to the form. They work, but when I reset the form, I cannot disable the ALL the controls.
I have to shift focus away from a control before disabling it, and since there are NO controls on my form except for these new ones, I cannot shift focus to something else in order to disable ALL the controls. I tried shifting focus to the form as whole, to various sections - no luck.
It is a little strange - in my dev machine, I have a newer version of Access, and there it works. I can disable a control even though it has focus, but the target user still has 2007, and there it does not work. I have to do pre-release tests on a special machine I have squirreled away with 2007 on it for this user.
In the new machine, I test ActiveControl after disabling everything, and it throws error 2474 - ActiveControl does not have focus, which makes sense - all my new controls are disabled and there is nothing else that can take focus. But in 2007, this seems to just not be possible.
I can bypass it by putting a hidden dummy control somewhere on the form and shifting focus to it, but it seems a clunky way of doing it, so I thought I'd see if anyone has a better idea.
I have to shift focus away from a control before disabling it, and since there are NO controls on my form except for these new ones, I cannot shift focus to something else in order to disable ALL the controls. I tried shifting focus to the form as whole, to various sections - no luck.
It is a little strange - in my dev machine, I have a newer version of Access, and there it works. I can disable a control even though it has focus, but the target user still has 2007, and there it does not work. I have to do pre-release tests on a special machine I have squirreled away with 2007 on it for this user.
In the new machine, I test ActiveControl after disabling everything, and it throws error 2474 - ActiveControl does not have focus, which makes sense - all my new controls are disabled and there is nothing else that can take focus. But in 2007, this seems to just not be possible.
I can bypass it by putting a hidden dummy control somewhere on the form and shifting focus to it, but it seems a clunky way of doing it, so I thought I'd see if anyone has a better idea.