|
-
Oct 20th, 2000, 12:49 PM
#1
Thread Starter
Lively Member
I have a sstab with 6 tabs. I have a few textboxes on one of the tabs with range checking. When I go from textbox to textbox, validation event executes. But when I am in a textbox and click a tab, validation doesn't execute. Sstab causesvalidation property is set to true. How can I make validation occur before going on to the next tab? Thanks.
-
Oct 20th, 2000, 01:00 PM
#2
Fanatic Member
Call the textbox_validate event from the sstab_click event. you'll have to pass a value to the cancel var of the validate event. but that should get you what you want.
www.RealisticGraphics.net
Running VS.Net Enterprise & VB 6
Other Languages: JavaScript, VBScript, VBA, HTML, CSS, ASP, SQL, XML
MSN Messenger: kmsheff
-
Oct 20th, 2000, 01:27 PM
#3
Thread Starter
Lively Member
Is there a way of telling which textbox was selected before the sstab was clicked so that I don't have to check all the textboxes for errors? My validation code is below. I can't get the sstab with the error to show up and setfocus on that textbox. Thanks.
Private Sub SSTab_Click(PreviousTab As Integer)
Call txtATW_Validate(False)
End Sub
Private Sub txtATW_Validate(Cancel As Boolean)
Call rangecheckTW(txtATW, Cancel)
End Sub
Private Sub rangecheckTW(txtTW As TextBox, Cancel As boolean)
If IsNumeric(txtTW) = False Then
txtTW.Text = 0
MsgBox "Need a number between 0 and 800"
Cancel = True
Call highlightselection(txtTW)
ElseIf txtTW.Text < 0 Or txtTW.Text > 800 Then
If txtTW.Text < 0 Then
txtTW.Text = 0
Else
txtTW.Text = 800
End If
MsgBox "Incorrect number. The range is between 0 and 800"
Cancel = True
Call highlightselection(txtTW)
End If
'txtTW.Text = Format$(txtTW.Text, "000")
End Sub
does it look correct?? Thanks
-
Jan 10th, 2001, 04:41 PM
#4
New Member
SSTab and TextBox validation
From the information on another posting, I solved the same problem by ensuring that all labels are contained on frames within the SSTab. I don't know why this works, but it seems to.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|