sly like Coyote
Registered User.
- Local time
- Today, 03:02
- Joined
- Apr 14, 2010
- Messages
- 82
I'm having problems setting the visibility of a command button to false after it's been clicked, and I'm not sure why.
When the user clicks the button, it's supposed to finish the on click sub by setting focus into the subform that becomes visible as a result of the click, and then set visible = false. I make sure the subform is visible before setting focus, and make sure to mention the control specifically when doing the Set Focus call. I still get the 2165 Error "You can't hide a control that has the focus".
I've tried multiple different setups for setting the subform visibility (which works fine every time) setting the focus (which apparently doesn't, even though I know the sub is getting called and not returning errors) and setting the visibility of the command button.
I'm pretty sure the problem lies with the SetFocus not taking effect before the visibility = false is called, but I've tried using a repaint as recommended in the Set Focus docs and that still didn't solve the problem. Anyone have any idea what's going wrong?
When the user clicks the button, it's supposed to finish the on click sub by setting focus into the subform that becomes visible as a result of the click, and then set visible = false. I make sure the subform is visible before setting focus, and make sure to mention the control specifically when doing the Set Focus call. I still get the 2165 Error "You can't hide a control that has the focus".
I've tried multiple different setups for setting the subform visibility (which works fine every time) setting the focus (which apparently doesn't, even though I know the sub is getting called and not returning errors) and setting the visibility of the command button.
I'm pretty sure the problem lies with the SetFocus not taking effect before the visibility = false is called, but I've tried using a repaint as recommended in the Set Focus docs and that still didn't solve the problem. Anyone have any idea what's going wrong?