Can a button not set itself to visible not true?

Ankarn

Registered User.
Local time
Today, 10:21
Joined
Jul 4, 2008
Messages
81
As the question in the title. I click a button, and if i answer yes in the following msgbox, i want something to happen, pluss the visibility of the very button i clicked to be false.

I get the message that i cant set a button thats in focus to not visible.
 
You need to shift focus to another (usually the next control or exit button) control first before making the active control invisible. You need to do something like this

Me.MyNextControlName.SetFocus
Me.MyButton.Visible=False

Good luck
 
but the SetFocus is just a formality, right?

I dont want to commit to a next button.
 
but the SetFocus is just a formality, right?
If it was a formality why would it exist? No, it's the source of your problem.

I dont want to commit to a next button.
Set the focus to anything you want, just not the button you want to hide.
 
when i said its a formality i ment its a formality in the sense that it's no rational reason to set the focus to controll b other than to get it away from controll a.

But i made it work. Thanks
 

Users who are viewing this thread

Back
Top Bottom