hide active button

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all,

I have a button with some events on it.
And I want it to hide itself after click as well, but Access says it still
has focus on it, so it cannot be hidden...

Can i add something into my code to somehow change the focus to another
element, - so that the last event for hiding this button works? or it is
impossible?

Thanks for help.
Lana
 
Yep: before the Cmd_YourButton.Visible=False line, put:

Me.[name of another control, which is Enabled].SetFocus

cheers


Seb
 
Lana said:
I have a button with some events on it.
And I want it to hide itself after click as well, but Access says it still
has focus on it, so it cannot be hidden...

Can i add something into my code to somehow change the focus to another
element, - so that the last event for hiding this button works? or it is
impossible?


Easy, just decide where the focus should be when the button
dissappears. the add a line of code (before making the
button invisible) to the button's Click event procedure:

Me.controlname.SetFocus
 
Back
Top