Office中国论坛/Access中国论坛

标题: 关于登录窗体问题? [打印本页]

作者: dbbygzy    时间: 2009-12-5 17:10
标题: 关于登录窗体问题?
我做了个登录窗体,其他都没问题,就是登录后,登录窗体关闭了,登录背景却不关闭,还是全屏的,库里的东西一个也看不见,是我做的不对,还是那个地方没弄合适啊,请高手们帮帮忙!!!
Private Sub Command4_Click()
On Error GoTo Err_Command4_Click
Dim STemp As String
        If IsNull(Me![用户编号]) Then
        MsgBox "请输入用户编号!", vbInformation, "人工造林管理系统提示"
        Me![用户编号].SetFocus
    ElseIf IsNull(Me![密码]) Then
        MsgBox "请输入登录密码!", vbInformation, "人工造林管理系统提示"
        Me![密码].SetFocus
    Else
    STemp = DLookup("密码", "用户信息表", "用户编号 = '" & Me![用户编号] & "'")
    UserName = DLookup("用户名", "用户信息表", "用户编号 = '" & Me![用户编号] & "'")
        If IsNull(STemp) Then
            DoCmd.close
                If CStr(Me![密码]) = STemp Then
                用户编号 = Me![用户编号]
                DoCmd.close , , acSaveNo
                Else
                MsgBox "您输入的密码不正确!", vbInformation, "人工造林管理系统提示"
                Me.Requery
                Me![密码].SetFocus
            End If
        End If
     End If
MsgBox ("欢迎使用人工造林管理系统!"), vbInformation, "人工造林管理系统提示"
Exit_Command4_Click:
    Exit Sub
   
Err_Command4_Click:
    MsgBox Err.Description
    Resume Exit_Command4_Click
End Sub
作者: gaoyh2008    时间: 2009-12-5 18:14
1# dbbygzy

DoCmd.close , , acSaveNo  

DoCmd.Close acForm, "登錄背景", acSaveYes  加上此句就可以了
作者: dbbygzy    时间: 2009-12-5 19:28
谢谢gaoyh2008 ,弄好了,非常感谢!!!




欢迎光临 Office中国论坛/Access中国论坛 (http://www.office-cn.net/) Powered by Discuz! X3.3