You can't disable a control while it has the focus

  • Thread starter Thread starter Stapes
  • Start date Start date
S

Stapes

Hi

I have a subform, Order Items, where I want to disable some of the
fields once the order is completed. Unfortunately, I get the error -
You can't disable a control while it has the focus.
OK. I am not setting the focus - it just happens to be the first field
in the subform.
Does the subform have to have a field with setfocus on it?

Stapes
 
hi Stapes,
I have a subform, Order Items, where I want to disable some of the
fields once the order is completed. Unfortunately, I get the error -
You can't disable a control while it has the focus.
OK. I am not setting the focus - it just happens to be the first field
in the subform.
Does the subform have to have a field with setfocus on it?
Nope. Try using .Locked = True instead of .Enabled = False.


mfG
--> stefan <--
 
Or use the line:

Me![Form Control].SetFocus

to set the focus to a form object that will not be disabled before you run
the rest of the code.
 
Back
Top