=>Private Sub Command19_Click()
On Error GoTo Err_Command19_Click
If Nz([Txt 密码]) = Nz(DLookup("[密码]", "用户密码", "[用户名] =" & "'" & Combo用户名 & "'")) And Me.
Combo用户名 <> "" Then '验证用户和密码)
DoCmd.Close
DoCmd.Close acForm, "登录背景", acSaveYes
Dim stDocName As String
Dim stLinkCriteria As String
DoCmd.OpenForm "main"
Else
MsgBox "用户名和密码错误", , "请重新输入"
Me.Combo 用户名.SetFocus
End If
Exit_cmd 确定_click:
Exit Sub
Exit_cmd 确定_click:
MsgBox Err.Description
Resume exit_cmd确定_click
End Sub
-------------------------------------------------------------------------------------------
Private Sub Command20_Click()
On Error GoTo Err_Command20_Click
DoCmd.Close
DoCmd.Quit
Exit_Command20_Click:
Exit Sub
Err_Command20_Click:
MsgBox Err.Description
Resume Exit_Command20_Click
End Sub
____________________________________________________________________________________________
是窗体的控件?还是表的