Assuming tbc2 is a tab control then I think that having parameters to tbc2_selectionchanged is wrong. I don't know if it is causing a problem but I'd first remove them. Having an empty string as a parameter is wrong anyway! Presumably you haven't optimised compiled this - I think the compiler would choke on that and the prescence of un-needed parameters.
If it's not the above then it's
only a guess but changing "tbc2.selectedindex=0" in the SelectionChanged event may cause another SelectionChanged event to occur and the Sub to be re-entered The first thing I would try is to comment out that line and see if the problem goes away. Then you could try
Code:
Sub Globals
InEvent = false
End Sub
Sub tbc2_selectionchanged(Index,"")
If InEvent then
Return
Else
InEvent = True
If tbc2.selectedindex > 0 AND hh=1 Then
tbc2.selectedindex=0
End If
InEvent = False
End If
End Sub