Tab Control Click Event not firing

G

Guest

I want to hide a listbox on the main form when the user clicks two of the
tabs on a tab control. Here's the code I used in the click event. I
couldn't even get a message box to show. Anyone have any ideas how to get
this to work?

Thanks,


Private Sub Page34_Click()

MsgBox "You clicked page 34"

If cbo_ProdCode.Visible = True Then
cbo_ProdCode.Visible = False
End If

End Sub
--
Billy Rogers

Dallas,TX

Currently Using SQL Server 2000, Office 2000 and Office 2003
 
G

George Nicholson

Don't use the Click event. Use the Change event of the tab control & test
it's current value (which will be the index value of the tab page just
clicked). The following uses the tab's Value to derive the name of the
currrent page:

Private Sub tabMain_Change()

Select Case Me.tabMain.Pages(Me.tabMain.Value).Name
Case "pgScenarioData" 'PageIndex 0

Case "pgUniversalData" 'PageIndex 1

Case "pgReports" 'PageIndex 2

Case "pgImportScorecard" 'PageIndex 6
Me.sctlScorecards.Form.Form_Activate

End Select

End Sub

HTH,
 

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