Current control

  • Thread starter Stephen @ ZennHAUS
  • Start date
S

Stephen @ ZennHAUS

Hi guys and gals

Is there an easy way to refer to the current control? For example when I
click on the drop arrow of a combo box, I want it to requery so that if the
source table the updates are reflected in the list. So, I figure that using
the OnClick event would be most appropriate and I was hoping for a simple
piece of code like Me.Requery to solve the problem. I know I can refer to
the actual control, but I want to be able to use the same piece of code for
each control that needs it rather than having to retype a new line with a
different control name.

Thanks

Stephen @ ZennHAUS
 
R

ruralguy via AccessMonster.com

Have you tried Screen.ActiveControl ?
Hi guys and gals

Is there an easy way to refer to the current control? For example when I
click on the drop arrow of a combo box, I want it to requery so that if the
source table the updates are reflected in the list. So, I figure that using
the OnClick event would be most appropriate and I was hoping for a simple
piece of code like Me.Requery to solve the problem. I know I can refer to
the actual control, but I want to be able to use the same piece of code for
each control that needs it rather than having to retype a new line with a
different control name.

Thanks

Stephen @ ZennHAUS
 
G

Graham Mandeno

Hi Stephen

Me.ActiveControl should do it.

However, if you are in the Click event procedure for a given control
(SomeControl_Click), you already *know* what the active control is - it's
SomeControl.
 

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

Top