Find out which tab was clicked

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.
 
G

Graham R Seach

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
 
A

Arvin Meyer

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
 
S

Silvester

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
 
Top