访问表单文本字段更新

时间:2014-04-24 14:27:24

标签: forms ms-access

用户已根据以下代码中提到的登录凭据访问不同的表单。取而代之的是,我希望所有用户打开相同的表单,即frm_search,其中未绑定的文本框即ZAO_Code,应显示在当前表单的"USER_NAME"字段中键入的文本。此外,用户无法更改ZAO_Code中更新的文字。

Private Sub Command8_Click()
    Dim stDocName As String
    Dim stLinkCriteria As String
    Dim USER_NAME As String

    LoginID.SetFocus
    USER_NAME = LoginID.Text
    Password.SetFocus
    If USER_NAME = "8902" Then
        If Password.Value = "T12!853G" Then
            stDocName = "Frm_8902"
        Else: MsgBox "Please Enter Correct Login Credentials"
        End If

    ElseIf USER_NAME = "8903" Then
        If Password.Value = "M14!8H3" Then
            stDocName = "Frm_8903"
        Else: MsgBox "Please Enter Correct Login Credentials"
        End If

    ElseIf USER_NAME = "8904" Then
        If Password.Value = "A12#853L" Then
            stDocName = "Frm_8904"
        Else: MsgBox "Please Enter Correct Login Credentials"
        End If

    ElseIf USER_NAME = "8906" Then
        If Password.Value = "J12!8M3" Then
            stDocName = "Frm_8906"
        Else: MsgBox "Please Enter Correct Login Credentials"
        End If

    ElseIf USER_NAME = "8907" Then
        If Password.Value = "K12!93L" Then
            stDocName = "Frm_8907"
        Else: MsgBox "Please Enter Correct Login Credentials"
        End If

    ElseIf USER_NAME = "8908" Then
        If Password.Value = "T99!853G" Then
            stDocName = "Frm_8908"
        Else: MsgBox "Please Enter Correct Login Credentials"
        End If

    ElseIf USER_NAME = "8909" Then
        If Password.Value = "F42!753L" Then
            stDocName = "Frm_8909"
        Else: MsgBox "Please Enter Correct Login Credentials"
        End If

    ElseIf USER_NAME = "8911" Then
        If Password.Value = "N12!#53B" Then
            stDocName = "Frm_8911"
        Else: MsgBox "Please Enter Correct Login Credentials"
        End If


    ElseIf USER_NAME = "8914" Then
        If Password.Value = "TG12!953T" Then
            stDocName = "Frm_8914"
        Else: MsgBox "Please Enter Correct Login Credentials"
        End If

    ElseIf USER_NAME = "8915" Then
        If Password.Value = "T12!M53Q" Then
            stDocName = "Frm_8915"
        Else: MsgBox "Please Enter Correct Login Credentials"
        End If

    ElseIf USER_NAME = "8917" Then
        If Password.Value = "T22!873E" Then
            stDocName = "Frm_8917"
        Else: MsgBox "Please Enter Correct Login Credentials"
        End If

    ElseIf USER_NAME = "8918" Then
        If Password.Value = "TG12!953T" Then
            stDocName = "Frm_8918"
        Else: MsgBox "Please Enter Correct Login Credentials"
        End If
    End If

0 个答案:

没有答案