Determined which field has the focus in code

C

Craig

I am trying to sort records in a subform. I would also like to sort the
records on subforms beside the first subform at the same time on the same
field. The ActiveControl property just gives back the value which does not do
me any good.
The Tag property does not help either.

Any work arounds or ideas?

TIA
-Craig
 
A

Albert D. Kallal

Craig said:
I am trying to sort records in a subform. I would also like to sort the
records on subforms beside the first subform at the same time on the same
field. The ActiveControl property just gives back the value which does not
do
me any good.
The Tag property does not help either.

I note sure what you mean by the above???

screen.activeContorl.Name will give you the name of the contorl.....

you might have to look down to the sub-form...

eg:

screen.activeContorl.form.activecontorl.name

The reason for this is that the active control on the screen is actually the
sub-form control......

normally, you can use:

me.ActiveContorl.name

The above will return the name of the current active control on the form....

It whole process is going to depend on how you fire this code. If you use a
button, then you changed the active control!!!!
This typically means then you have to use a shortcut control..or a menu bar
option which does NOT change the focus.
 
Top