Link to home
Start Free TrialLog in
Avatar of chestera
chestera

asked on

Tab form on click event

Hi EE

How do I get the on click event to work on a TAB Form. As a test I entered msgbox("Something"). but when I click the tab I don't get the message. Looking at some E.E questions & answers, "On Change event" is mentioned but I can't find. I am working on access 2003 at the moment. Any help most appreciated

chestera
Avatar of savic7uk
savic7uk
Flag of Greece image

Hi try this where TabCtl0 your tabcontrol name

Private Sub TabCtl0_Change()
If Me.TabCtl0.Value = 0 Then 'First Page
  'Do code for Page 1
ElseIf Me.TabCtl0.Value = 1 Then 'Second page
  'Do code for Page 2
ElseIf Me.TabCtl0.Value = 2 Then 'Third page
  'Do code for Page 3
End If
End Sub

Open in new window



Or with case


Private Sub TabCtl0_Change()
  Select Case TabCtl0
    Case 0  'First Page
      'Code for Page 1
    Case 1  'Second page
      'Code for Page 2
   Case 2   'Third page
     'Code for Page 3
  End Select
End Sub

Open in new window

Avatar of chestera
chestera

ASKER

savic7uk

Where do I find tab change. I have looked

Alan
savic7uk

Yes I see My tab is called Site and the second tab so it's page 1. Do  I place the code in  the click event of the tab called Site

Alan
ASKER CERTIFIED SOLUTION
Avatar of savic7uk
savic7uk
Flag of Greece image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
savic7uk

I am looking at 2003 and I don't have the change event. But I can work it out from here many thanks for your help

Alan
savic7uk

I have closed this question so hope you don't mind asking another question. I have a copy of access 2013 even in this version Tab/Property there are Click, Doubleclick, Mouseup and mouse down events can't find the Change event

Alan
savic7uk

I have finally worked it out. Use the form change Change event not the tab.
With the rest of you info it's working. Once again thank you for your help

Alan