I'm working with Access 2003.
I have a subform on which I need to set the focus away from controls I need to disable, but only if the focus is on the columns to be disabled. I need to do this in the Form_Current event handler, where I run code like this:
fNeedToSetFocus = (Screen.ActiveControl.Name = "txtComTaxRateGst" Or Screen.ActiveControl.Name = "txtComTaxRatePst")
Unfortunately, when the subform is loading, it seems that Form_Current cannot always see the ActiveControl and throws Error 2474 on the above line of code:
The expression you entered requires the control to be in the active window.
Is there any way around this?
Thanks for any help you can give.
Wayne
I have a subform on which I need to set the focus away from controls I need to disable, but only if the focus is on the columns to be disabled. I need to do this in the Form_Current event handler, where I run code like this:
fNeedToSetFocus = (Screen.ActiveControl.Name = "txtComTaxRateGst" Or Screen.ActiveControl.Name = "txtComTaxRatePst")
Unfortunately, when the subform is loading, it seems that Form_Current cannot always see the ActiveControl and throws Error 2474 on the above line of code:
The expression you entered requires the control to be in the active window.
Is there any way around this?
Thanks for any help you can give.
Wayne