Find out which tab was clicked

  • Thread starter Thread starter Silvester
  • Start date Start date
S

Silvester

I have an A2000 form with a 3- page tab control named Personal Data,
Contacts & History.

When users click the History page tab I'd like a messagebox to fire with a
brief description of what data needs to be entered on that page.

How can I achieve this ?

Thanks for any help.
 
Silvester,

I think your users will rapidly tire of having a MsgBox pop up every time
they select the History tab. I think you're better to (a) modify the design
of that tab page to include such information, or (b) provide an icon on that
page which will then, at the user's request, display a MsgBox.

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia

Microsoft Access 2003 VBA Programmer's Reference
http://www.wiley.com/WileyCDA/WileyTitle/productCd-0764559036.html
 
Use the Change event to read which page is clicked:

Private Sub TabCtl1_Change()
MsgBox "Clicked Tab# " & Me.TabCtl1 + 1
If Me.TabCtl1 = 2 Then MsgBox "Whatever"
End Sub

The pages are indexed with a zero (0) base which is why the code above adds
1 to the control. The second line of code refers to the 3rd tab.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 
Graham,

You're probably right !

Thanks

Graham R Seach said:
Silvester,

I think your users will rapidly tire of having a MsgBox pop up every time
they select the History tab. I think you're better to (a) modify the design
of that tab page to include such information, or (b) provide an icon on that
page which will then, at the user's request, display a MsgBox.

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia

Microsoft Access 2003 VBA Programmer's Reference
http://www.wiley.com/WileyCDA/WileyTitle/productCd-0764559036.html


with
 
Back
Top