1.
Form Create User
Dim proses As String
Private Sub cedit_Click()
proses = "edit"
Call kosong
[Link]
End Sub
Private Sub cexit_Click()
[Link]
End Sub
Private Sub chapus_Click()
If [Link] = "&Hapus" Then
proses = "Hapus"
[Link]
[Link] = "&Ok"
Else
If [Link] = "&Ok" Then
[Link] = "select * from tcreateuser where user_name='" + [Link] + "' and
Password='" + [Link] + "' and Status='" + [Link] + "'"
[Link]
If Not [Link] Then
If proses = "Hapus" Then
[Link]
MsgBox "Remove User Berhasil"
[Link] = "&Hapus"
Call kosong
Else
MsgBox "Belum Ada"
End If
Else
MsgBox "Ra ono"
Call kosong
End If
[Link] = "&Hapus"
End If
End If
End Sub
Private Sub cinput_Click()
proses = "input"
Call kosong
[Link]
End Sub
Private Sub csimpan_Click()
If [Link] <> [Link] Then
MsgBox "Anda Salah Memasukan Konfirmasi Password"
[Link] = ""
[Link]
Exit Sub
End If
If [Link] = "" Or [Link] = "" Or [Link] = "" Or [Link] = "" Then
MsgBox "Harap Isi User Name,Password dan Status"
Exit Sub
End If
If MsgBox("Sutuju Untuk Disimpan?", vbQuestion + vbYesNo, "Simpan Data") = vbYes Then
If [Link] = "USER" Then
[Link] = "select * from tcreateuser where user_name='" + [Link] + "'"
[Link]
If Not [Link] Then
If proses = "input" Then
MsgBox "User Name ='" + [Link] + "'Sudah Terdaftar"
Exit Sub
End If
Else
If proses = "input" Then
GoTo a
End If
End If
End If
If proses = "edit" Then
GoTo d
End If
a:
[Link] = "select *from tcreateuser where Status='" + [Link] + "'"
[Link]
If Not [Link] Then
If Not proses = "edit" Then
If [Link]!Status = "ADMIN" Or [Link]!Status = "admin" Then
MsgBox "Status Admin Sudah Ada,Silahkan Pilih Hak Akses Yang Lain!", vbInformation, "Pesan"
Exit Sub
End If
End If
End If
GoTo p
d:
[Link] = "select *from tcreateuser where user_name='" + [Link] + "'"
[Link]
p:
With [Link]
If proses = "input" Then
.AddNew
End If
!user_name = [Link]
!Password = [Link]
!Status = [Link]
.Update
Call kosong
End With
Else
Call kosong
[Link]
End If
End Sub
Private Sub cstatus_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
If [Link] = "" Then
MsgBox "Pilih Status"
Else
If proses = "Hapus" Then
[Link]
Exit Sub
End If
[Link]
End If
End If
End Sub
Private Sub tconfirm_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If [Link] = "" Then
MsgBox "Masukan Confirm Password"
Else
[Link]
End If
End If
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If [Link] = "" Then
MsgBox "MASUKAN NIP"
Else
[Link]
End If
End If
End Sub
Private Sub tpassbaru_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If [Link] = "" Then
MsgBox "Harap Isi Password"
Else
[Link]
End If
End If
End Sub
Private Sub tpasslama_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If [Link] = "" Then
MsgBox "Masukan Password Lama Anda"
Else
With [Link]
If [Link] <> !Password Then
MsgBox "Password Yang Anda Masukan Salah"
Call kosong
[Link]
Else
If proses = "Hapus" Then
[Link]
[Link] = False
Exit Sub
End If
[Link] = True
[Link]
End If
End With
End If
End If
End Sub
Private Sub tusername_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If [Link] = "" Then
MsgBox "Isi User"
Else
[Link] = "select * from tcreateuser where user_name='" + [Link] + "'"
[Link]
If Not [Link] Then
If proses = "input" Then
MsgBox "User Name ='" + [Link] + "'Sudah Terdaftar"
Exit Sub
End If
With [Link]
[Link] = !user_name
End With
If proses = "edit" Then
[Link] = True
[Link]
End If
If proses = "Hapus" Then
[Link] = True
[Link]
End If
Else
If proses = "input" Then
[Link] = False
[Link] = True
[Link]
Else
MsgBox "User Name='" + [Link] + "'Tidak Ada"
Call kosong
[Link]
End If
End If
End If
End If
End Sub
Public Sub kosong()
[Link] = ""
[Link] = ""
[Link] = ""
[Link] = ""
[Link] = ""
End Sub
Public Sub edit()
With [Link]
If proses = "edit" Then
If [Link] <> [Link] Then
MsgBox "Confirm Password Salah"
[Link] = ""
[Link]
Exit Sub
End If
!user_name = [Link]
!Password = [Link]
!Status = [Link]
!kode = [Link]
.Update
End If
End With
End Sub
2. Form Login
Private Sub Command1_Click()
[Link] = "select * from tcreateuser where user_name='" + [Link] + "' and
Password='" + [Link] + "' "
[Link]
If Not [Link] Then
With [Link]
[Link]
[Link]
[Link]
End With
Else
MsgBox "Password/User/Status Anda Salah"
[Link] = ""
[Link] = ""
End If
End Sub
Private Sub Command2_Click()
[Link]
End Sub
Private Sub tpass_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If [Link] = "" Then
MsgBox "Masukan Password"
Else
[Link]
End If
End If
End Sub
Private Sub tuser_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If [Link] = "" Then
MsgBox "Masukan User Name Anda"
Else
[Link]
End If
End If
End Sub
3. Form Menu
Private Sub creat_Click()
[Link]
End Sub