[AccessD] Can't Disable Control

Stuart McLachlan stuart at lexacorp.com.pg
Mon Mar 15 20:45:27 CDT 2010


Where are you running the code?  In an event procedure for a control?
What has control has got the focus when the code starts?

Looks as though cboCTNID is the active control on the subform. Try setting focus to 
something else on the subform.


-- 
Stuart

On 15 Mar 2010 at 17:44, Rocky Smolin wrote:

> Dear List:
> 
> In the following code:
> 
>     Me.subfrmFormulaBOM!fldFormulaBOMSequence.Enabled = False
>     Me.cmdExit.SetFocus
>     Me.subfrmFormulaBOM!cboCTNID.Enabled = False
>     Me.subfrmFormulaBOM!fldCTNPricePerPound.Enabled = False
>     Me.subfrmFormulaBOM!fldFormulaBOMQuantity.Enabled = False
>     Me.subfrmFormulaBOM!cmd100.Enabled = False
> 
> 
> when it tries to execute     Me.subfrmFormulaBOM!cboCTNID.Enabled = False I
> get an error 2164 - you can't disable a control while it has the focus.  I
> stuck that Me.cmdExit.SetFocus in there right before the line just to make
> sure the focus was elsewhere but I get it anyway.
> 
> I'm thinking this is one of those error messages that doesn't really mean
> what it says but I don't know.
> 
> Any guesses?
> 
> BTW cboCTNID is a bound control like the others - bound to a field in the
> record source.
> 
> MTIA
> 
>  
> 
> Rocky Smolin
> 
> Beach Access Software
> 
> 858-259-4334
> 
> www.e-z-mrp.com <http://www.e-z-mrp.com/> 
> 
> www.bchacc.com <http://www.bchacc.com/> 
> 
>  
> 
>  
> 
> 





More information about the AccessD mailing list