By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,558 Members | 1,373 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,558 IT Pros & Developers. It's quick & easy.

Can't get ActiveControl from Form_Current event

P: n/a
When I run the following code from a continuous form's Current event:
Set ctrl = Me.ActiveControl
I get an error 2474 - 'The expression you entered requires the control to be
in the active window'.
I've tested it in simple (1 field) forms with no other code, and get the
same result.
Is it not possible to get this value from the Form_Current event?
Screen.ActiveControl gives the same result.

--
Bob Darlington
Brisbane
Oct 23 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
At the moment that the Form_Current event is raised, no control has the
focus. So, to answer your question, it is not possible to capture this
value within the Form_Current event.

"Bob Darlington" <bo*@dpcmanAX.com.auwrote in message
news:45***********************@news.optusnet.com.a u...
When I run the following code from a continuous form's Current event:
Set ctrl = Me.ActiveControl
I get an error 2474 - 'The expression you entered requires the control to
be
in the active window'.
I've tested it in simple (1 field) forms with no other code, and get the
same result.
Is it not possible to get this value from the Form_Current event?
Screen.ActiveControl gives the same result.

--
Bob Darlington
Brisbane


Oct 23 '06 #2

P: n/a
Thanks for the reply.
I think I was coming to that conclusion, but I saw a number of references to
using it in the Current event from posters with some standing in this NG.

--
Bob Darlington
Brisbane
"ByteMyzer" <sb*@news.sf.sbcglobal.netwrote in message
news:PG**************@newssvr11.news.prodigy.com.. .
At the moment that the Form_Current event is raised, no control has the
focus. So, to answer your question, it is not possible to capture this
value within the Form_Current event.

"Bob Darlington" <bo*@dpcmanAX.com.auwrote in message
news:45***********************@news.optusnet.com.a u...
>When I run the following code from a continuous form's Current event:
Set ctrl = Me.ActiveControl
I get an error 2474 - 'The expression you entered requires the control to
be
>in the active window'.
I've tested it in simple (1 field) forms with no other code, and get the
same result.
Is it not possible to get this value from the Form_Current event?
Screen.ActiveControl gives the same result.

--
Bob Darlington
Brisbane



Oct 23 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.