i have a SSTab1 which have 4 tabs (2 combo3 and 2 combo4 in each Tab)... and i use the code below to check the input of the SSTab1...
if have a error.. then a msgbox will pop up and then focus to the offending combobox ... but there is a bug..
eg.)if the offending combobox is at Tab0 and i'm at Tab0 then it's work... but..if i were in Tab2, then it can't setfocus to the offending combobox at Tab0
wish you can follow...
Public Sub Check_Click()
For i = 0 to 3
For j = 0 to 1
If Combo3((i * 2) + j).Text = "No" Then
If Combo4((i * 2) + j).Text = "No" Then
msg(1) = "Error!! Push button needed on " & Form4.SSTab1.TabCaption(i)
Message(1) = MsgBox(msg(1), vbCritical)
Form4.Combo4((i * 2) + j).SetFocus
Exit Sub
End If
End If
Next j
Next i
End Sub
if have a error.. then a msgbox will pop up and then focus to the offending combobox ... but there is a bug..
eg.)if the offending combobox is at Tab0 and i'm at Tab0 then it's work... but..if i were in Tab2, then it can't setfocus to the offending combobox at Tab0
wish you can follow...
Public Sub Check_Click()
For i = 0 to 3
For j = 0 to 1
If Combo3((i * 2) + j).Text = "No" Then
If Combo4((i * 2) + j).Text = "No" Then
msg(1) = "Error!! Push button needed on " & Form4.SSTab1.TabCaption(i)
Message(1) = MsgBox(msg(1), vbCritical)
Form4.Combo4((i * 2) + j).SetFocus
Exit Sub
End If
End If
Next j
Next i
End Sub