VB的if语句的问题Private Sub Command1_Click()If Text1 = "111" ThenForm3.ShowEnd IfElseIf Text1 = "" ThenMsgBox "错误!"6,"系统错误"End IfEnd Sub怎么改当Text1=111时 Form3.show当Text1不是111时 MsgBox "错误",6,"系统错误"怎么

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/09 03:38:09
VB的if语句的问题Private Sub Command1_Click()If Text1 =

VB的if语句的问题Private Sub Command1_Click()If Text1 = "111" ThenForm3.ShowEnd IfElseIf Text1 = "" ThenMsgBox "错误!"6,"系统错误"End IfEnd Sub怎么改当Text1=111时 Form3.show当Text1不是111时 MsgBox "错误",6,"系统错误"怎么
VB的if语句的问题
Private Sub Command1_Click()
If Text1 = "111" Then
Form3.Show
End If
Else
If Text1 = "" Then
MsgBox "错误!"6,"系统错误"
End If
End Sub
怎么改
当Text1=111时 Form3.show
当Text1不是111时 MsgBox "错误",6,"系统错误"
怎么写?

VB的if语句的问题Private Sub Command1_Click()If Text1 = "111" ThenForm3.ShowEnd IfElseIf Text1 = "" ThenMsgBox "错误!"6,"系统错误"End IfEnd Sub怎么改当Text1=111时 Form3.show当Text1不是111时 MsgBox "错误",6,"系统错误"怎么
Private Sub Command1_Click()
'先判断为空时则出错
If Text1 = "" Then
MsgBox "错误!"6,"系统错误"
exit sub
end if
If Text1 = "111" Then Form3.Show
End Sub
或者
Private Sub Command1_Click()
If Text1 = "111" Then
Form3.Show
else
MsgBox "错误!"6,"系统错误"
end if
End Sub