0

Hi friends....

I am using SS Tab in my form. There are 4 tabs in total. The user needs to enter a text provided on tab1 and then go to tab2. If the user clicks on tab2 without entering text in the textbox, a message box should be shown to the user and the focus should be set on tab1 again....

Please help me on this....

Thanks,
Dinil

3
Contributors
8
Replies
9
Views
8 Years
Discussion Span
Last Post by dinilkarun
Featured Replies
  • 1

    Add on click event (you can find combo box filled with sstab event on the top of code window) This following code will make u can't open other tabs without fill textbox 1 (text1). [code=vb] Private Sub SSTab1_Click(PreviousTab As Integer) If Text1.Text = "" Then ' add as u needed … Read More

0

just try my suggestion...

use if then statement to trap it...
put the codes on the 2nd tab with click action...
put a msgbox...

try this code...

if SStab1.text1.text = "" then
msgbox ("You should Enter Data first on the first tab", vbokonly,"Error") = vbok
SSTab1.setfocus..
end if

hope im right and i did help you....

Note: the name i used in the objects should be changed according to how you named it to your project..

0

sorry about that one.....

try this...

If Text1.Text = "" Then

If MsgBox("You should Enter Required Data", vbOKOnly, "Error") = vbOK Then
SSTab1.Tab = 0
End If

End If

hope this will really help you.....

just make sure in your properties the 1st tab... its TAB property is set to 0
and the next tab is TAB property is set to 1....

0

Hi...
In which event do I put the above piece of code??....
I tried with this:
Private Sub SSTab1_DblClick()
If Text1.Text = "" Then

If MsgBox("You should Enter Required Data", vbOKOnly, "Error") = vbOK Then
SSTab1.Tab = 0
End If

End If

End Sub

This is not working....

1

Add on click event (you can find combo box filled with sstab event on the top of code window)
This following code will make u can't open other tabs without fill textbox 1 (text1).

Private Sub SSTab1_Click(PreviousTab As Integer)
If Text1.Text = "" Then ' add as u needed
    SSTab1.Tab = 0
End If
End Sub
Comments
:twister:
0

Thanks a lot.....
Its working perfectly....
Thanks once again

Cheers,
Dinil

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.