|
将楼主的代码修改了,如下:
Private Sub Command4_Click()
Dim rst As New ADODB.Recordset
Dim strsql As String
strsql = "select 用户名,密码 from 用户名"""
rst.Open strsql, CurrentProject.Connection, adOpenKeyset, adLockOptimistic
Dim i As Long ''---------
rst.MoveFirst ''---------
For i = 0 To rst.RecordCount - 1 ''---------
If Trim(Me.Combo13) = Trim(rst.Fields(0)) And Trim(Me.Text2) = Trim(rst.Fields(1)) Then
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = ChrW(20999) & ChrW(25442) & ChrW(-26782) & ChrW(26495)
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit Sub ''---------
Else
MsgBox "登陆失败,请重新登陆"
Me.Combo13.SetFocus
End If
rst.MoveNext
Next ''---------
rst.Close ''---------
Set rst = Nothing ''---------
End Sub
''---------表示添加的代码行
|
|