Someone please help me with my tabstrip in Visual basic!

LuckyTaxi

Diamond Member
Dec 24, 2000
6,044
23
81
In the following sub 'Private Sub TabStrip1_Click(),' I placed the following lines of code after displaying an error message
that tells the user he/she must answer ALL questions in the current tab before going to the next tab. What happened before
was that I could click on tab 2 and the error message comes up, but the focus is now on the second tab, BUT I return to where
I was left off. It confuses the user since the focus is now on the secnod tab. So, I placed the code below, and it does go back to tab
1, but VB is treating it as a click event, therefore it jumps back to the top of the sub and goes through the whole sub again, hence,
displaying the error message every time!

With TabStrip1
.Tabs(1).Selected = True
.Setfocus
End With

 

StageLeft

No Lifer
Sep 29, 2000
70,150
5
0
Hmm, real quick if you're not using validation set to true on any controls and you're doing it your way and you just can't seem to get around that click event what you can do is set a public variable that is a boolean and when you are forced back to tab 1 again set that variable to true which will tell all of the code in the click event to only go if the boolean is false