Public OK As Boolean
Private Sub cmdCancel_Click()
    OK = False
    Me.Hide
End Sub
Private Sub cmdok_Click()
     Dim txtSQL As String
    Dim mrc As ADODB.Recordset
    Dim MsgText As String
    If Trim(txtUserName.Text = "") Then
        MsgBox "没有这个用户,请重新输入用户名!", vbOKOnly+ +vbExclamation, "警告"
        txtUserName.SetFocus
    Else
         UserName = Trim(txtUserName.Text)
        txtSQL = "select * from user_info where user_ID = '" & txtUserName.Text & "'"
        Set mrc = ExecuteSQL(txtSQL, MsgText)
        If mrc.EOF = True Then------当我一调试的时候,系统就提示我的对象变量或WITH块变量未设置
            MsgBox "没有这个用户,请重新输入用户名!", vbOKOnly + vbExclamation, "警告"
            txtUserName.SetFocus
        Else
            If Trim(mrc.Fields(1)) = Trim(txtPassword.Text) Then
                OK = True
                mrc.Close
                Me.Hide
                UserName = Trim(txtUserName.Text)
            Else
                MsgBox "输入密码不正确,请重新输入!", vbOKOnly + vbExclamation, "警告"
                txtPassword.SetFocus
                txtPassword.Text = ""
            End If
        End If
    End If
    
    miCount = miCount + 1
    If miCount = 3 Then
        Me.Hide
    End If
    Exit Sub
End Sub想问一下是什么原因