When i was entered into login page
the code is here

Private Sub txt_Password_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    If UCase(txt_Password) = UCase(txt_dbPassword) Then
        Unload Me
       Modification_Main.Enabled = True
        'unlock database here
    Else
        MsgBox "Invalid password.", vbExclamation
        txt_Password.SetFocus
        SendKeys "{home}" & "+{end}"
        counter = counter + 1
        If counter = 3 Then
            MsgBox "You have reached the maximum tries to enter wrong password." & Chr(13) & _
                "System is terminating.", vbExclamation
            End
        End If
    End If
End If
If KeyAscii = 27 Then
    End
End If
End Sub

the error showing Compiler error,Cant find project or Library

Edited 5 Years Ago by Narue: Added code tags

this line indicating error

Private Sub txt_Password_KeyPress(KeyAscii As Integer)

In the IDE click on the Project menu item then select References. At the top will be the libraries that are selected for the project. The troublesome one should have "Missing" in the description.

please tell what is that application....i dont know which one is that

please i dont know that the following code is error

Private Sub txt_Password_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    If UCase(txt_Password) = UCase(txt_dbPassword) Then
        Unload Me
       Modification_Main.Enabled = True
        'unlock database here
    Else
        MsgBox "Invalid password.", vbExclamation
        txt_Password.SetFocus
        SendKeys "{home}" & "+{end}"
        counter = counter + 1
        If counter = 3 Then
            MsgBox "You have reached the maximum tries to enter wrong password." & Chr(13) & _
                "System is terminating.", vbExclamation
            End
        End If
    End If
End If
If KeyAscii = 27 Then
    End
End If
End Sub

that redline is error

Edited 3 Years Ago by Reverend Jim: Fixed formatting

SO what is the error message.

it would be simpler to put a login button on the screen and put the code under that.

Also you need to ensure the variable counter is declared at the module level otherwise it will be reinitialised each keypress and be useless to you.

This article has been dead for over six months. Start a new discussion instead.