On Change Event on a tab control

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
 
R

Rick Brandt

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.
 

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