如何解决根据登录表单将文本框设置为只读
在我的访问数据库中,我有成功登录尝试后下一次打开的登录表单,但是现在我需要进行一次修改,但我不知道该怎么做: 只有两个用户使用此数据库,并且都使用相同的表单输入数据,但是根据用户,表单中的某些文本框需要只读或隐藏,请帮助我实现此目的。
Option Compare Database
Option Explicit
Private Sub btnlogin_Click()
Dim RS As Recordset
Set RS = CurrentDb.OpenRecordset("logintable",dbOpenSnapshot,dbReadOnly)
RS.FindFirst "UserName='" & Me.txtUsername & "'"
If RS.NoMatch = True Then
Me.lblwronguser.Visible = True
Me.txtUsername.SetFocus
Exit Sub
End If
Me.lblwronguser.Visible = False
If RS!Password <> Nz(Me.txtPassword,"") Then
Me.lblwrongpassword.Visible = True
Me.txtPassword.SetFocus
Exit Sub
End If
Me.lblwrongpassword.Visible = False
DoCmd.Close acForm,"Login screen"
DoCmd.OpenForm "Main Menu"
End Sub
If Me.txtPassword = "trial" Then
DoCmd.Close acForm,"Login screen"
DoCmd.OpenForm "frmwhatdates"
Form!frmwhatdates!cmdfilter.Visible = False
Exit Sub
End If
"Runtime Error 2467 The expression you entered refers to an object that is closed or doesn't exist"
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。