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/10/08 01:19:33
VB的if语句的问题PrivateSubCommand1_Click()IfText1="111"ThenForm3.ShowEndIfElseIfText1=""ThenMsgBox"错误!"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,"系统错误"怎么
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