我借别人的例子做了一个登陆窗体,点“确定”后出现了“类型不匹配”的错误提示,各位高手可以给我看看吗?先谢了!下面是源码:(运行到红色的那行出错)
Private Sub Command1_Click()
Dim rst As Recordset
If IsNull(Me.Code) Then
Me.Code.SetFocus
Exit Sub
End If
If IsNull(Me.Password) Or Password = "" Then
Set rst = CurrentDb().OpenRecordset("select * from tabGrpUser where ((GrpUsrID='" & Code & "') And (PassWord Is Null Or PassWord='') );")
Else
Set rst = CurrentDb().OpenRecordset("select * from tabGrpUser where ((GrpUsrID='" & Code & "') And (PassWord='" & Password & "') );")
End If
If Not rst.EOF Then
Me.UsrName = rst![GrpUsrName]
Me.Visible = False
DoCmd.Close acForm, "登陆背景"
Me.TimerInterval = 0
DoCmd.Close acForm, Me.Name
DoCmd.OpenForm "控制台"
Else
Me.Password.SetFocus
End If
End Sub
[此贴子已经被作者于2004-3-6 1:54:37编辑过]
|