Tabel Login

Kode Program
Option Explicit
Dim Password As String
Dim x As Integer
Private Sub CMD_Keluar_Click()
End
End Sub
Private Sub CMD_OK_Click()
If Text_user_name = "" Then
MsgBox "Nama Anda Harus di Isi Terlebih Dahulu!", vbOKOnly + vbCritical, "SALAH"
End If
cekpassword
End Sub
Private Sub cekpassword()
If Text_password = Password Then
MsgBox "akses Telah Di Terima!Selamat Datang," & UCase(Text_user_name), , "OK"
Unload Me
Form_menu_utama.Show
Else
If x = 3 Then
MsgBox "Anda Tidak Berhak Mengoprasikan Aplikasi ini", vbOKOnly + vbCritical, "MAAF"
End
Else
MsgBox "password salah,silahkan masukan kembali!" & Chr(10) & "kesempatan anda " & 3 - x & "lagi", vbOKOnly + vbCritical, "Password salah"
x = x + 1
Text_password.SetFocus
Exit Sub
End If
End If
End Sub
Private Sub form_activate()
Password = "stmik"
Text_user_name.SetFocus
x = 1
End Sub
Private Sub text_password_keypress(keyascii As Integer)
If keyascii = 13 Then
CMD_OK_Click
End If
End Sub
Private Sub text_user_name_keypress(keyascii As Integer)
If keyascii = 13 Then
Text_password.SetFocus
End If
End Sub