一个选择性问题
Private Sub Command1_Click()If Text1.Text = "" Then
MsgBox "内容不能为空!", vbOKOnly + vbExclamation, "警告!"
Text1.SetFocus
Else
If Option1(1).Value = True Then
SQL = "select * from t1 where jgmc='" & Trim(Text1.Text) & "'"
Set rs1 = TransactSQL(SQL)
If rs1.EOF = True Then '判断是否已经存在用户
MsgBox "该企业不存在!请重新输入!", vbOKOnly + vbExclamation, "警告"
Text1.SetFocus
Text1.Text = ""
Else
SQL = "delete * from t1 where jgmc='" & Trim(Text1.Text) & "'"
Set rs1 = TransactSQL(SQL)
rs1.Close
MsgBox "删除成功!", vbOKOnly + vbExclamation, "删除成功"
If Option1(1).Value = False Then
SQL = "select * from t1 where jgdm='" & Trim(Text1.Text) & "'"
Set rs = TransactSQL(SQL)
If rs.EOF = True Then '判断是否已经存在
MsgBox "该组织代码不存在!请重新输入!", vbOKOnly + vbExclamation, "警告"
Text1.SetFocus
Text1.Text = ""
Else
SQL = "delete * from t1 where jgdm='" & Trim(Text1.Text) & "'"
Set rs = TransactSQL(SQL)
rs.Close
MsgBox "删除成功!", vbOKOnly + vbExclamation, "删除成功"
End If
End If
End If
End If
End If
End Sub
红色不分就是运行不起来 编译是通过的是不是if else 的结构问题?请教大侠们