also check the names of your controls
Main Topics
Browse All TopicsI am trying to set up an On Click event for a tab control on an Access form. I have set it up the same way as any other event. It runs a couple lines of code.
For whatever reason, it won't fire. I have also tried setting up the on click event for the individual pages in the tab control, but they won't fire either.
Any ideas.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
when you click a tab in the tab control it is not the same as clicking the tab control itself. which is what the onclick event fires on.
when you click a tab it simply displays the controls on that page - then you need to figure out which page was clicked. pages are 0 based. so if you have a button on your form in its onclick event you can figure out which page of the tab control is active, the default property of the tab control is its active page:
Private Sub Command4_Click()
'pages start at zero
Select Case Me.TabCtl0
Case 0: MsgBox "This is Page 1"
Case 1: MsgBox "This is Page 2"
Case 2: MsgBox "This is Page 3"
End Select
End Sub
this help?
John
jbrienct,
Possibly. So perhaps I need clarification on what needs to happen to get the Tab contol On Click event to fire. I assumed that clicking anywhere within the control, on any tab or on a control on the tab would fire the tab control On click event. Is this not the case? If not, how would a user ever fire the Tab Control On Click Event.
Similarly, I have put the same code in the On Click events for each of the 5 tabs (pages) I have in the Tab Control. They never fire either. Is this related?
depending on what you are doing you may want to use
Forms![frmParticipant].Req
instead
from mskb
SUMMARY
Although the Requery, Repaint, and Records Refresh items are different, you can use each of them to ensure that what you see on the screen is updated.
MORE INFORMATION
Requery
The Requery macro action updates controls, such as list boxes and combo boxes. It works for the form on which those controls exist only if you don't include arguments.
Repaint
Repaint is not related to data; it merely redraws the object or control. If there is data that has been updated in the underlying dynaset but is not reflected on the form, you cannot use Repaint.
Records Refresh
Records Refresh requeries the form itself, as opposed to any control on the form.
"BTW, is there a document somewhere the lists what events happen in what order? "
http://support.microsoft.c
But it is the click event that I want. Basically, I want to know when the user moves from the main form to the tab control. At that point I want to ensure the record from the main form is saved, before the user begins editing the information on the Tab control. Once the user is on the tab, I don't care whether they move from tab to tab.
So the click event, when a user clicks on the tab control best represents the event that I want to fire. If only it would actually go off.
If there are Absolute Requirements that exist before the user can enter into the data control on the tab, AND those controls ON the tab are not needed to complete the main record. The "Hide Tab til Save Button" simply makes the most sense to me.
If you are GOING to use the On click you have to devise an exit condition that you can use to pre-empt the routine in it's early stages.
Also keep in mind that there are interactions that can occur on the tab that won't fire the tabs click event, so depending on that to save your record is less then desirable. Mike has it right, if you need to save dat before allowing use of the tab control then do it explicity - in a save button that enables the tab control when its done.
John
hoenth,
Have a dummy tab as first tab (on this tab put company logo etc to fill it up, no data text boxes). Now, in order to move to any other tab, OnChange event of the tab-control could be used to accomplish what you are trying to do.
Also, when you enter new data on the main form, make sure to bring up the dummy tab.
Mike
Business Accounts
Answer for Membership
by: capricorn1Posted on 2004-01-29 at 18:24:49ID: 10231960
check the property of the control
select event tab
and on the onclick
select event procedure