OnClick not doing a thing!!! (1 Viewer)

agehoops

Registered User.
Local time
Today, 07:48
Joined
Feb 11, 2006
Messages
351
I'm using a tab box on a form, and want to use the OnClick event of the tab buttons along the top. I have the option of the OnClick event, but no matter what the code is behind, it won't run!!! Why not? It's really annoying me

Thanks
 

agehoops

Registered User.
Local time
Today, 07:48
Joined
Feb 11, 2006
Messages
351
seems it is, but only the area under the actual tab button which just makes it useless!!! How can I got about making it the button itself?
 

cpremo

Registered User.
Local time
Yesterday, 23:48
Joined
Jun 22, 2007
Messages
50
Can you post your code? Are there multiple tabs? How about pasting a picture of the form?
 

agehoops

Registered User.
Local time
Today, 07:48
Joined
Feb 11, 2006
Messages
351
The code is literally something like

txtMonth = 1

That's it. It does work, but only when i click the area just under the tab button which is really stupid
 

RuralGuy

AWF VIP
Local time
Today, 00:48
Joined
Jul 2, 2005
Messages
13,826
Frustrating isn't it? Use the Change event of the Tab control instead. As you discovered, the Click event is all but useless.
 

agehoops

Registered User.
Local time
Today, 07:48
Joined
Feb 11, 2006
Messages
351
That works, but how do I then determine which of the buttons has just been selected? Seeing as there are 12 tabs?
 

boblarson

Smeghead
Local time
Yesterday, 23:48
Joined
Jan 12, 2001
Messages
32,059
That works, but how do I then determine which of the buttons has just been selected? Seeing as there are 12 tabs?

You could use this for the index value:
Code:
Select Case Me.YourTabControlName.Value
or you can use the name of the tab
Code:
Select Case Me.YourTabControlName.Pages(Me.YourTabControlName.Value).Name
 

agehoops

Registered User.
Local time
Today, 07:48
Joined
Feb 11, 2006
Messages
351
perfect! Thanks so much, just what I needed. This forum is the best :D
 

Users who are viewing this thread

Top Bottom