0

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 by Narue: Added code tags

4
Contributors
9
Replies
11
Views
5 Years
Discussion Span
Last Post by ChrisPadgham
0

this line indicating error

Private Sub txt_Password_KeyPress(KeyAscii As Integer)

0

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.

0

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

0

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 by Reverend Jim: Fixed formatting

0

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 topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.