Private Sub CmdCancel_Click()
Private Sub cmdlogin_Click()
username= txtusername.Text
password= Val (txtpassword.Text)
If Adodcl.Recordset.Fields("User") = username And Adodcl.Recordset.Fields("Pass") = password Then
Msgbox " You have been successful Log in", vbInformation, "Login"
Msgbox "Username/Password field is wrong", vbCritical, "Login"
If txtusername.Text = " " Then
Msgbox "Username field can not be left blank",
If txtpassword.Text = " " Then
Msgbox "Password field can not be left blank",
Msgbox "your three attempts have been over"
Private Sub form_activate()
Private Sub txtusername_Change()
Private Sub txtusername_KeyPress(KeyAscii As Integer)
If (KeyAscii >= 65 And KeyAscii <= 90) Or (KeyAscii >= 97 And KeyAscii <= 122) Or KeyAscii = 8 then