1. Menu Utama Private Sub abt_Click
frmAbout.Show End Sub
Private Sub dafAbsenHar_Click frmDafAbsensiHar.Show
End Sub Private Sub dafPeg_Click
frmDafPegawai.Show End Sub
Private Sub dafUser_Click frmDaftarUser.Show
End Sub Private Sub FA_Click
frmAbsensi.Show End Sub
Private Sub FP_Click frmPegawai1.Show
End Sub Private Sub FU_Click
frmUser.Show End Sub
Private Sub K_Click End
End Sub Private Sub LapAbsensiBul_Click
frmLapAbsensiBul.Show End Sub
Private Sub LapAbsensiHar_Click frmLapAbsensiHar.Show
End Sub Private Sub login_Click
frmLogin.Show End Sub
Private Sub logout_Click mnuFile.Enabled = False
mnuAbsen.Enabled = False mnuLap.Enabled = False
bolLogon = False End Sub
Private Sub MDIForm_Activate If bolLogon = True Then
mnuFile.Enabled = True mnuAbsen.Enabled = True
mnuLap.Enabled = True Else
Universitas Sumatera Utara
mnuFile.Enabled = False mnuAbsen.Enabled = False
mnuLap.Enabled = False End If
End Sub Private Sub Toolbar1_ButtonClickByVal Button As MSComctlLib.Button
Select Case Button.Index Case 1
If bolLogon = True Then frmPegawai1.Show
End If Case 2
If bolLogon = True Then frmAbsensi.Show
End If Case 3
End End Select
End Sub Private Sub Timer1_Timer
If bolLogon = True Then StatusBar1.Panels1.Text = Jam : FormatNow, HH:MM:SS
StatusBar1.Panels2.Text = Tanggal : FormatDate, _
d MMMM yyyy StatusBar1.Panels3.Text = USER ID: UserID
Else UserID =
StatusBar1.Panels1.Text = Jam : StatusBar1.Panels2.Text = Tanggal :
StatusBar1.Panels3.Text = USER ID: End If
End Sub 2. Login
Option Explicit Dim rsUser As Recordset
Private Sub cmdCancel_Click Me.Hide
Unload Me End Sub
Private Sub cmdOK_Click On Error Resume Next
UserID = txtUser.Text Set rsCari = New ADODB.Recordset
rsCari.Open Select from [uUser] where UserId= _
txtUser.Text and Passwd= txtPass.Text , _ CN, adOpenDynamic, adLockOptimistic
If rsCari.EOF = True Then MsgBox Password salah
txtPass = txtUser =
bolLogon = False txtUser.SetFocus
Else Me.Hide
bolLogon = True
Universitas Sumatera Utara
MenuUtama.Show End If
End Sub Private Sub Form_Activate
txtPass = txtUser =
txtUser.SetFocus End Sub
Private Sub Form_Load Koneksi
End Sub Private Sub txtPass_KeyPressKeyAscii As Integer
If KeyAscii = 13 Then cmdOk.Enabled = True
cmdOk.SetFocus End If
End Sub Private Sub txtUser_KeyPressKeyAscii As Integer
If KeyAscii = 13 Then txtPass.Locked = False
txtPass.SetFocus End If
End Sub 3. Logout
mnuFile.Enabled = False mnuAbsen.Enabled = False
mnuLap.Enabled = False bolLogon = False
4. Data Pegawai Option Explicit