How to hide button that has focus

I

ipellew

Hi;

I have a simple form that hides a few fields on the form when each
record is displayed.

I want to hide the button that shows the field that is 'visible=false',
but get "cannot hide when focus" when I press the button.

Advice please.

Regards
Ian
 
F

fredg

Hi;

I have a simple form that hides a few fields on the form when each
record is displayed.

I want to hide the button that shows the field that is 'visible=false',
but get "cannot hide when focus" when I press the button.

Advice please.

Regards
Ian

Set the focus to any other field first, then hide the button:

[SomeControl].Visible = False
[AnyOtherControl].SetFocus
[ThisButtonName].Visible = False
 
Top