A
ArielZusya
I'm struggling with a runtime issue (at least I think that's how best to
describe this) in Access 2007. I've got code that causes, when a particular
form is loaded, a custom ribbon to become visible. I've got other code that
causes a particular tab on the ribbon to gain focus (thanks to Tony Jollans).
The trouble is, if the ribbon is not visible and is made visible, the code
switching focus to that ribbon doesn't seem to do anything (it runs without
error but it doesn't result in the newly visible tab to have the focus). On
the other hand, if the tab is already visible, the switch focus sub routine
works and the focus changes. Any idea why this would be?
In detail, what I'm doing is:
1) loading a form
2) in the on load I've got code that checks a global Boolean to see if the
ribbon is visible
3) if it is I don't change it but if it isn't I set the Boolean to true and
then reinitialize the ribbon using invalidate
4) I then check to see what state my data is in and if certain data exists I
have code that uses the invalidate and Booleans to cause particular buttons
and groups on the ribbon to become visible and invisible
5) I call code that switches the focus to the tab of my choosing
It seems that if the system does anything at steps 3 and 4 then it doesn't
do anything at step 5. I have this weird feeling that, when it does do
something at steps 3 and/or 4 it may be switching focus to the tab of my
choosing at step 5 but then switching back to the tab furthest to the left.
At any rate, if someone can tell me how to solve this problem, I'd be
grateful! Thanks for your help!
Ariel
describe this) in Access 2007. I've got code that causes, when a particular
form is loaded, a custom ribbon to become visible. I've got other code that
causes a particular tab on the ribbon to gain focus (thanks to Tony Jollans).
The trouble is, if the ribbon is not visible and is made visible, the code
switching focus to that ribbon doesn't seem to do anything (it runs without
error but it doesn't result in the newly visible tab to have the focus). On
the other hand, if the tab is already visible, the switch focus sub routine
works and the focus changes. Any idea why this would be?
In detail, what I'm doing is:
1) loading a form
2) in the on load I've got code that checks a global Boolean to see if the
ribbon is visible
3) if it is I don't change it but if it isn't I set the Boolean to true and
then reinitialize the ribbon using invalidate
4) I then check to see what state my data is in and if certain data exists I
have code that uses the invalidate and Booleans to cause particular buttons
and groups on the ribbon to become visible and invisible
5) I call code that switches the focus to the tab of my choosing
It seems that if the system does anything at steps 3 and 4 then it doesn't
do anything at step 5. I have this weird feeling that, when it does do
something at steps 3 and/or 4 it may be switching focus to the tab of my
choosing at step 5 but then switching back to the tab furthest to the left.
At any rate, if someone can tell me how to solve this problem, I'd be
grateful! Thanks for your help!
Ariel