Tab form on click event

chestera
chestera used Ask the Experts™
on
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
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
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

Author

Commented:
savic7uk

Where do I find tab change. I have looked

Alan

Author

Commented:
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
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Commented:
Well, if i remember correctly

1.

go to  Design View

2.

right click on tablcontrol --> Properties

3.

In the property sheet (usually open on the right of the screen) select the tab control if not selected

4.

Select Event Tab

5.

press the [...] button next to change event
accessproperties.png

Author

Commented:
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

Author

Commented:
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

Author

Commented:
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

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial