Friday, November 9, 2007

Login for Access Application



OK, its very easy make a login form for any application with vb (of course).
Here i make count if any mistakes of entry both user name or password.
User only 3 times to try. If 3 times mistakes, so the form will terminated!
Of course, it will show a message if there's a mistakes...

here, the code...

Dim salah As Byte

Private Sub Command1_Click()
If Text1.Text = "adi" And Text2.Text = "vb" Then
MsgBox "Login sukses!", vbInformation, "oke"
Else
MsgBox "Login gagal!", vbCritical, "no"
salah = salah + 1
If salah = 3 Then
MsgBox "Anda sudah salah 3x!" & Chr(10) & "Aplikasi akan mati!", vbInformation, "look"
End
End If
Text1.Text = ""
Text2.Text = ""
Text1.SetFocus
End If
End Sub

Private Sub Command2_Click()
End
End Sub


click here to download...

No comments: