On Error GoTo err_cmdok_click
Dim rs As ADODB.Recordset
Dim str As String
Dim num As Integer
Dim username As String
Dim password As String
username = Trim(combo7)
password = Trim(text2)
Set rs = New ADODB.Recordset
If IsNull(username) Then
DoCmd.Beep
MsgBox ("lease choose username")
If IsNull(password) Then
DoCmd.Beep
MsgBox ("lease input password")
Else
str = "select * from 登陆表 where 登陆表.部门名称='" & username & "'and 登陆表.密码='" & password & "'"
Set rs = GetRs(str)
If rs.EOF Then
DoCmd.Beep
MsgBox ("lease input ")
combo7 = ""
text2 = ""
text2.SetFocus
End If
End If
Exit Sub
Else
DoCmd.Close
Me![cmdok].SetFocus
MsgBox ("wlecome to this systerm")
check = True
DoCmd.OpenForm ("工时输入窗体")
'DoCmd.OpenForm "工时输入窗体", , , "[部门] = 'combo7'"
End If
Set rs = Nothing
Set conn = Nothing
exit_cmdok_click:
Exit Sub
err_cmdok_click:
MsgBox Err.Description
Resume exit_cmdok_click