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

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
 
S

Stefan Hoffmann

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 <--
 
N

Nicholas Scarpinato

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.
 

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