setting enabled to false for button

G

Guest

Hi,
I've got a event procedure on_click for 'button' and the last line in
procedure is
Form!someForm!button.enabled = false
but that doesn't seem to work.
Any suggestions please?

thanx

alek_mil
 
S

Sandy H

Try....

Forms!Mainform!ControlName.Enabled

Note that 'Forms' should be used rather than Form.

Sandy
 
G

Guest

Hi,
Form is email typo only, I've got Forms in code.

Might there be a problem with disabling a control that currently has focus?

alek_mil
 
J

John Spencer

Yes, you cannot disable a button that has the focus. You must set the focus
elsewhere.

Forms!someForm!AnotherControlThatCanGetFocus.SetFocus

Forms!someForm!button.enabled = false

Note that not all controls can get the focus. For instance, Labels cannot
get the focus and any control that is not enabled cannot get the focus.

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top