On Change Event on a tab control

  • Thread starter Thread starter Mark
  • Start date Start date
M

Mark

I have an Access 97 database. On one form there is a tab
control that has several pages. I want to run some code
whenever the user clicks on one particular page. The only
way I found that I could do that is if I run the code on
the "On Change" event for the tab control. That works,
except that it runs the code whenever the user clicks on
ANY of the pages. I only want the code to run when when
ONE SPECIFIC page is clicked(the page is pagLetters). Is
there a line of code that I can insert that basically says
that if the current active control is "pagLetter" then run
the code and otherwise not?

Thanks if you have an answer!

Mark
Ontario, Canada
 
Mark said:
I have an Access 97 database. On one form there is a tab
control that has several pages. I want to run some code
whenever the user clicks on one particular page. The only
way I found that I could do that is if I run the code on
the "On Change" event for the tab control. That works,
except that it runs the code whenever the user clicks on
ANY of the pages. I only want the code to run when when
ONE SPECIFIC page is clicked(the page is pagLetters). Is
there a line of code that I can insert that basically says
that if the current active control is "pagLetter" then run
the code and otherwise not?

If Me.TabControlName.Value = n Then...

Where n is the index of the desired page.
 
Back
Top