VBA: Disabling a control

  • Thread starter Thread starter Joan
  • Start date Start date
J

Joan

How does one disable a button right after it has been clicked? I tried
setting the button's Enabled property to false on it's click event but I got
a message that this was not allowed when the control has the focus.

Joan
 
Move the focus elseware then disable.

SomeOtherControl.SetFocus
cmdbutton.enabled = false

Ron W
 
Exactly - I often put a .001x.001 textbox on my forms and set focus to it.
It's too tiny to be seen and it doesn't seem as confusing as having the
cursor bounce off to some arbitray field/control.
 
Back
Top