Determined which field has the focus in code

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
Screen.ActiveControl.Name tells you the name of the active control.
 
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.
 

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

Back
Top