how to test if a particular control has focus?

后端 未结 2 1497
春和景丽
春和景丽 2021-01-19 05:07

i have access 2007 form and i want to test if a particular control (toggle button) has the focus ,

something like :

if gotfocus(mytoggle) then
dosom         


        
2条回答
  •  长发绾君心
    2021-01-19 05:36

    Unfortunately, there are situations where the .ActiveControl is temporary non-existing ! When records are scrolled in a form, the procedure Form_Current() gets run. Already at the beginning, there is no focus anymore – the focus is reset to the previous field only after Form_Current() has terminated.

提交回复
热议问题