VB 判断语句问题
来源:百度知道 编辑:UC知道 时间:2024/05/12 20:37:38
Dim a As String
a = Text1.Text
If Text1.Text <> "" Then
If IsNumeric(a) Then
If Len(a) <> 5 Then
MsgBox "请输入5位数字的职工编号!"
Text1.SetFocus
End If
Else
MsgBox "职工编号是由数字组成!"
Text1.SetFocus
End If
Exit Sub
Else
MsgBox "职工编号必填"
End If
Text1.SetFocus
Exit Sub
Adodc1.Recordset.Save
Command5.Enabled = True
Command6.Enabled = True
Command7.Enabled = True
Command8.Enabled = True
End Sub
现在是如果输入5位数字后,程序没反应了,不走Adodc1.Recordset.Save
Command5.Enabled = True
Command6.Enabled = True
Command7.Enabled = True
Command8.Enabled = True这步,请哪位高手给“点”一下
把那个exit sub 去掉,Command5.Enabled = True
Command6.Enabled = True
Command7.Enabled = True
Command8.Enabled = True 还是不响应啊
a = Text1.Text
If Text1.Text <> "" Then
If IsNumeric(a) Then
If Len(a) <> 5 Then
MsgBox "请输入5位数字的职工编号!"
Text1.SetFocus
End If
Else
MsgBox "职工编号是由数字组成!"
Text1.SetFocus
End If
Exit Sub
Else
MsgBox "职工编号必填"
End If
Text1.SetFocus
Exit Sub
Adodc1.Recordset.Save
Command5.Enabled = True
Command6.Enabled = True
Command7.Enabled = True
Command8.Enabled = True
End Sub
现在是如果输入5位数字后,程序没反应了,不走Adodc1.Recordset.Save
Command5.Enabled = True
Command6.Enabled = True
Command7.Enabled = True
Command8.Enabled = True这步,请哪位高手给“点”一下
把那个exit sub 去掉,Command5.Enabled = True
Command6.Enabled = True
Command7.Enabled = True
Command8.Enabled = True 还是不响应啊
Private Sub Command1_Click()
Dim a As String
a = Text1.Text
If a = "" Then
MsgBox "职工编号必填"
Text1.SetFocus
Exit Sub
End If
If IsNumeric(a) = False Then
MsgBox "职工编号是由数字组成!"
Text1.SetFocus
Exit Sub
End If
If Len(a) <> 5 Then
MsgBox "请输入5位数字的职工编号!"
Text1.SetFocus
Exit Sub
End If
Adodc1.Recordset.Save
Command5.Enabled = True
Command6.Enabled = True
Command7.Enabled = True
Command8.Enabled = True
End Sub