首先我想你的本意应该是:
If Text1.Text = "" Then
MsgBox "姓名不能为空!", vbOKOnly + vbExclamation, ""
Text1.SetFocus
Text1 = ""
'ADD
exit sub
End If
If Text1.Text = "" Then
MsgBox "姓名不能为空!", vbOKOnly + vbExclamation, ""
Text1.SetFocus
Text1 = ""
'ADD
exit sub
End If
rs.close
endif
rs.CursorLocation = adUseClient//对象打开时,无法操作。
這樣就可以了