Triggering a macro when changing from one tab to next

  • Thread starter Thread starter VMiller
  • Start date Start date
V

VMiller

I am using an entry form that had been designed to trigger
a warning and prevent the user from leaving the current
page/subform?/tab? until the error is fixed. However, the
macro is only triggered when the user clicks the button
for the next sheet, and I use ctrl/tab to navigate to the
next page. How do I get a macro to run? Is it OnExit?
OnLostFocus? The only options available when I right
click on the tab in design view are OnClick, and some
Mouse ones. I think I am supposed to use the OnClick but
I won't be clicking anything with the mouse. HELP ME
PLEASE!!!
 
There should be an "OnChange" event for the tab control.
This triggers whenever you move from one page to another
on the control. You can check which page you are on
(which one you have moved to) with:

TabControlName.Value

The values are 0,1,2,3, . . . starting with the leftmost
tab page.
 
Back
Top