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
Microsoft Access

Avatar of undefined
Last Comment
chestera

8/22/2022 - Mon
savic7uk

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

chestera

ASKER
savic7uk

Where do I find tab change. I have looked

Alan
chestera

ASKER
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
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
ASKER CERTIFIED SOLUTION
savic7uk

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
chestera

ASKER
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
chestera

ASKER
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
chestera

ASKER
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
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.