Page tab control

Eljefegeneo

Still trying to learn
Local time
Today, 03:26
Joined
Jan 10, 2011
Messages
902
I have tried to use the various page tab control events to no avail. They just don't seem to work at all. All I want to do it to clear several unbound text boxes on a tab page when I click on the tab control. I know that I can click anywhere on the page to get the desired result, but I want to be able to click on the tab. Is there any way of doing this? It is only needed for one tab. Why are the five events there anyway if they don't function?
 
Are you looking at Object Tabs or a Tab control on a form?

attachment.php
 
I am looking at what you have circled. So I guess they are the Tab controls on a form. There are five events associated with a tab. I hope I am speaking about the right thing.
 
I've attached a simple DB that shows what I am trying to do. The form in the Db has a further explanation. I know that there are all kinds of way to do this, I just want to make it so easy that even my users who are not very computer literate can use it.
 

Attachments

OK, you where using the Page's On Click event, which only fires when the body of the page is clicked.

You need to put the following code in the Tab Controls On Click event;
Code:
Private Sub TabCtl14_Click()

If TabCtl14.Value = 0 Then
    Me.TS1 = ""
    Me.TS2 = ""
    Me.TS3 = ""
    Me.TS4 = ""
    Me.TS5 = ""
End If

End Sub
 

Attachments

I see what you have done, and please correct me if I am wrong. You have to identify the page with the If TabCtl14.Value = Page Index, then you can add the code. Thanks again. Saved me time and now I can delete the code from other places - I had it in the OnClose event for the report. Not a great place to have it.
 
It's not strictly necessary, you could put the code without the If Then and it would simply run whenever the user clicked on any of the tabs.

I put it in more as an illustration of how you could determine which of the tabs was clicked :)
 

Users who are viewing this thread

Back
Top Bottom