• Tidak ada hasil yang ditemukan

Manajemen Kinerja

DAFTAR PUSTAKA

13. Form Hapus Absensi Pegawai

Desy Masraudha : Sistem Informasi Kepegawaian Pada Dinas Pekerjaan Umum Kabupaten Asahan Menggunakan Visual Basic 6.0, 2008.

USU Repository © 2009

Desy Masraudha : Sistem Informasi Kepegawaian Pada Dinas Pekerjaan Umum Kabupaten Asahan Menggunakan Visual Basic 6.0, 2008.

USU Repository © 2009 LISTING PROGRAM

Form Utama

Private Sub h1_Click() frmHBagian.Show End Sub

Private Sub h2_Click() frmHPegawai.Show End Sub

Private Sub h3_Click() frmHAbsensi.Show End Sub

Private Sub l1_Click() L03.Show

End Sub

Private Sub l2_Click()

L01.Show End Sub

Private Sub l3_Click() L02.Show

End Sub

Private Sub l4_Click() L02.Show

End Sub

Private Sub m1_Click() frmTBagian.Show End Sub

Desy Masraudha : Sistem Informasi Kepegawaian Pada Dinas Pekerjaan Umum Kabupaten Asahan Menggunakan Visual Basic 6.0, 2008.

USU Repository © 2009

Private Sub m2_Click() frmTPegawai.Show End Sub

Private Sub m3_Click() frmTAbsensi.Show End Sub

Private Sub MDIForm_DblClick() Unload Me

End Sub

Private Sub MDIForm_Load() Connect

End Sub

Private Sub MDIForm_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)

If Button = 2 Then PopupMenu mnuedit End If

End Sub

Private Sub mnuklr_Click() End

End Sub

Private Sub Timer1_Timer()

Me.Caption = Right$(Me.Caption, Len(Me.Caption) - 1) + Left$(Me.Caption, 1) StatusBar1.Panels(1) = Format(Date, "dd mmmm yyyy")

StatusBar1.Panels(2) = Format(Time, "hh:mm:ss") End Sub

Private Sub u1_Click() frmEBagian.Show End Sub

Private Sub u2_Click() frmEPegawai.Show End Sub

Private Sub u3_Click() frmEAbsensi.Show End Sub

Desy Masraudha : Sistem Informasi Kepegawaian Pada Dinas Pekerjaan Umum Kabupaten Asahan Menggunakan Visual Basic 6.0, 2008.

USU Repository © 2009 Form Data Bagian

Private Sub cmdBatal_Click() Call CleanControls

Me.txt_kd_bag.SetFocus

End Sub

Private Sub CmdKeluar_Click() Unload Me

End Sub

Private Sub CmdSimpan_Click() If Me.txt_kd_bag.Text <> "" And _ Me.txt_nm_bag.Text <> "" Then Call Simpan Frame3.Visible = True Timer1.Enabled = True cmdBatal_Click

MsgBox "Data sudah tersimpan!", vbExclamation, "Simpan Data" Else PesanKosong frmTBagian Exit Sub End If End Sub

Private Sub Form_Activate() Me.txt_kd_bag.SetFocus

Desy Masraudha : Sistem Informasi Kepegawaian Pada Dinas Pekerjaan Umum Kabupaten Asahan Menggunakan Visual Basic 6.0, 2008.

USU Repository © 2009

Private Sub Form_KeyPress(KeyAscii As Integer) If KeyAscii = 27 Then

Unload Me

ElseIf KeyAscii = 13 Then SendKeys "{Tab}" End If

End Sub

Private Sub CleanControls() For Each txt In Me.Controls If TypeOf txt Is TextBox Then txt.Text = ""

ElseIf TypeOf txt Is ComboBox Then txt.ListIndex = -1

End If Next

End Sub

Private Sub Simpan()

SQlSimpan = "INSERT INTO bagian VALUES('" & Me.txt_kd_bag.Text & "'," & _ "'" & Me.txt_nm_bag.Text & "'," & _

"'" & Me.txt_divisi.Text & "');"

Conn.Execute (SQlSimpan)

End Sub

Private Sub Form_Load() Call SetFormCenter(Me)

End Sub

Private Sub tgl_lahir_Click() cthn = Year(Me.tgl_lahir.Value)

If Val(cthn) >= 1953 And Val(cthn) <= 1991 Then

Desy Masraudha : Sistem Informasi Kepegawaian Pada Dinas Pekerjaan Umum Kabupaten Asahan Menggunakan Visual Basic 6.0, 2008.

USU Repository © 2009

MsgBox "Pengisian tanggal lahir salah!", vbCritical, "Tanggal Lahir" Me.tgl_lahir.SetFocus Exit Sub End If End Sub

Private Sub nm_pel_KeyPress(KeyAscii As Integer) IsiDataText1

If InStr(Isitext, Chr(KeyAscii)) = 0 And KeyAscii <> vbKeyBack And KeyAscii <> vbKeyDelete And KeyAscii <> vbKeySpace Then

KeyAscii = 0 End If

End Sub

Private Sub telp_KeyPress(KeyAscii As Integer) IsiDataText3

If InStr(Isitext, Chr(KeyAscii)) = 0 And KeyAscii <> vbKeyBack And KeyAscii <> vbKeyDelete And KeyAscii <> vbKeySpace Then

KeyAscii = 0 End If

End Sub

Form Biodata Pegawai

Private Sub cbokd_bag_Change() cbokd_bag_Click

End Sub

Private Sub cbokd_bag_Click()

Call OpenTable("SELECT * FROM [bagian] WHERE kd_bag='" & Me.cbokd_bag.Text & "'", rsRS)

With rsRS

If Not .EOF Then

Me.txt_nm_bag.Text = .Fields("nm_bag") Me.txt_divisi.Text = .Fields("divisi")

Desy Masraudha : Sistem Informasi Kepegawaian Pada Dinas Pekerjaan Umum Kabupaten Asahan Menggunakan Visual Basic 6.0, 2008. USU Repository © 2009 End If End With End Sub

Private Sub cmdBatal_Click() Call CleanControls

Me.txt_nip.SetFocus

End Sub

Private Sub CmdKeluar_Click() Unload Me

End Sub

Private Sub CmdSimpan_Click() If Me.txt_nip.Text <> "" And _ Me.txt_nm_peg.Text <> "" And _ Me.cbo_agama.Text <> "" And _ Me.cbo_jenkel.Text <> "" And _ Me.txt_nm_bag.Text <> "" Then Call Simpan Frame3.Visible = True Timer1.Enabled = True cmdBatal_Click

MsgBox "Data sudah tersimpan!", vbExclamation, "Simpan Data" Else PesanKosong frmTPegawai Exit Sub End If End Sub

Private Sub Form_Activate() Me.txt_nip.SetFocus

Desy Masraudha : Sistem Informasi Kepegawaian Pada Dinas Pekerjaan Umum Kabupaten Asahan Menggunakan Visual Basic 6.0, 2008. USU Repository © 2009 End Sub

Private Sub Form_KeyPress(KeyAscii As Integer) If KeyAscii = 27 Then

Unload Me

ElseIf KeyAscii = 13 Then SendKeys "{Tab}" End If

End Sub

Private Sub CleanControls() For Each txt In Me.Controls If TypeOf txt Is TextBox Then txt.Text = ""

ElseIf TypeOf txt Is ComboBox Then txt.ListIndex = -1

End If Next

End Sub

Private Sub Simpan()

SQlSimpan = "INSERT INTO biodata VALUES('" & txt_nip.Text & "'," & _ "'" & Me.txt_nm_peg.Text & "'," & _

"'" & Me.cbo_jenkel.Text & "'," & _ "'" & Me.dt_tgl_lahir.Value & "'," & _ "'" & Me.txt_t_lahir.Text & "'," & _ "'" & Me.cbo_agama.Text & "'," & _ "'" & Me.dt_tgl_angkat.Value & "'," & _ "'" & Me.cbo_pendidikan.Text & "'," & _ "'" & Me.cbokd_bag.Text & "'," & _ "'" & Me.jabatan.Text & "');"

Conn.Execute (SQlSimpan) End Sub

Desy Masraudha : Sistem Informasi Kepegawaian Pada Dinas Pekerjaan Umum Kabupaten Asahan Menggunakan Visual Basic 6.0, 2008.

USU Repository © 2009

Private Sub Form_Load() Call SetFormCenter(Me)

Call Loadkd_bagToCombo("SELECT*FROM bagian", rsRS, Me.cbokd_bag) End Sub

Private Sub dt_tgl_lahir_Click() cthn = Year(Me.dt_tgl_lahir.Value)

If Val(cthn) >= 1953 And Val(cthn) <= 1991 Then

Else

MsgBox "Pengisian tanggal lahir salah!", vbCritical, "Tanggal Lahir" Me.dt_tgl_lahir.SetFocus

Exit Sub

End If End Sub

Private Sub txt_nip_KeyPress(KeyAscii As Integer) IsiDataText2

If InStr(Isitext, Chr(KeyAscii)) = 0 And KeyAscii <> vbKeyBack And KeyAscii <> vbKeyDelete And KeyAscii <> vbKeySpace Then

KeyAscii = 0 End If

End Sub

Private Sub txt_nm_peg_KeyPress(KeyAscii As Integer) IsiDataText1

If InStr(Isitext, Chr(KeyAscii)) = 0 And KeyAscii <> vbKeyBack And KeyAscii <> vbKeyDelete And KeyAscii <> vbKeySpace Then

KeyAscii = 0 End If

End Sub

Desy Masraudha : Sistem Informasi Kepegawaian Pada Dinas Pekerjaan Umum Kabupaten Asahan Menggunakan Visual Basic 6.0, 2008.

USU Repository © 2009

Private Sub cbonip_Click()

Call OpenTable("SELECT * FROM [biodata] WHERE nip='" & Me.cbonip.Text & "'", rsRS)

With rsRS

If Not .EOF Then

Me.txt_nm_peg.Text = .Fields("nm_peg") End If

End With End Sub

Private Sub cmdBatal_Click() Call CleanControls

'Call LoadDataToListView("SELECT * FROM [transaksi_pembayaran_cicilan]", rsRS, lv1, 4)

Me.cbonip.SetFocus

End Sub

Private Sub CmdKeluar_Click() Unload Me

End Sub

Private Sub CmdSimpan_Click() If Me.cbonip.Text <> "" And _ Me.cbo_keterangan.Text <> "" Then Call Simpan Frame3.Visible = True Timer1.Enabled = True cmdBatal_Click

MsgBox "Data sudah tersimpan!", vbExclamation, "Simpan Data" Else PesanKosong frmTAbsensi Exit Sub End If End Sub

Desy Masraudha : Sistem Informasi Kepegawaian Pada Dinas Pekerjaan Umum Kabupaten Asahan Menggunakan Visual Basic 6.0, 2008.

USU Repository © 2009

Private Sub Form_Activate() Me.cbonip.SetFocus

Me.dt_tgl_abs.Value = Date End Sub

Private Sub Form_KeyPress(KeyAscii As Integer) If KeyAscii = 27 Then

Unload Me

ElseIf KeyAscii = 13 Then SendKeys "{Tab}" End If

End Sub

Private Sub CleanControls() For Each txt In Me.Controls If TypeOf txt Is TextBox Then txt.Text = ""

ElseIf TypeOf txt Is ComboBox Then txt.ListIndex = -1

End If Next

End Sub

Private Sub Simpan()

SQlSimpan = "INSERT INTO absensi (nip,tgl_abs,keterangan) VALUES('" & Me.cbonip.Text & "'," & _

"'" & Me.dt_tgl_abs.Value & "'," & _ "'" & Me.cbo_keterangan.Text & "');" Conn.Execute (SQlSimpan) End Sub

Private Sub Form_Load()

Call LoadnipToCombo("SELECT*FROM biodata", rsRS, Me.cbonip) Call SetFormCenter(Me)

Desy Masraudha : Sistem Informasi Kepegawaian Pada Dinas Pekerjaan Umum Kabupaten Asahan Menggunakan Visual Basic 6.0, 2008.

USU Repository © 2009

End Sub

Form Edit Data Bagian

Private Sub cmdBatal_Click() Call CleanControls

Me.cbokd_bag.SetFocus cbokd_bag.Text = "" End Sub

Private Sub CmdKeluar_Click() Unload Me

End Sub

Private Sub CmdSimpan_Click()

If Me.cbokd_bag.Text <> "" Then

Call Perbaiki cmdBatal_Click

Call LoadDataToListView("SELECT * FROM [bagian]", rsRS, lv1, 10) Frame3.Visible = True Timer1.Enabled = True Else PesanKosong frmEBagian Exit Sub End If End Sub

Private Sub Form_Activate() Me.cbokd_bag.SetFocus End Sub

Desy Masraudha : Sistem Informasi Kepegawaian Pada Dinas Pekerjaan Umum Kabupaten Asahan Menggunakan Visual Basic 6.0, 2008.

USU Repository © 2009

If KeyAscii = 27 Then Unload Me

ElseIf KeyAscii = 13 Then SendKeys "{Tab}" End If

End Sub

Private Sub Form_Load()

Call LoadDataToListView("SELECT * FROM [bagian]", rsRS, lv1, 10) Call SetFormCenter(Me)

Call Loadkd_bagToCombo("SELECT*FROM bagian", rsRS, Me.cbokd_bag)

Call SetFormCenter(Me)

End Sub

Private Sub CleanControls() For Each txt In Me.Controls If TypeOf txt Is TextBox Then txt.Text = ""

ElseIf TypeOf txt Is ComboBox Then txt.ListIndex = -1

End If Next

cbokd_bag.Text = "" End Sub

Private Sub nm_bag_KeyPress(KeyAscii As Integer) IsiDataText1

If InStr(Isitext, Chr(KeyAscii)) = 0 And KeyAscii <> vbKeyBack And KeyAscii <> vbKeyDelete And KeyAscii <> vbKeySpace Then

KeyAscii = 0 End If

End Sub

Private Sub cbokd_bag_Change() cbokd_bag_Click

End Sub

Desy Masraudha : Sistem Informasi Kepegawaian Pada Dinas Pekerjaan Umum Kabupaten Asahan Menggunakan Visual Basic 6.0, 2008.

USU Repository © 2009

Call OpenTable("SELECT * FROM [bagian] WHERE kd_bag='" & Me.cbokd_bag.Text & "'", rsRS)

With rsRS

If Not .EOF Then Me.txt_nm_bag.Text = .Fields("nm_bag") Me.txt_divisi.Text = .Fields("divisi") End If End With End Sub

Private Sub cbokd_bag_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then

cbokd_bag_Click End If

End Sub

Private Sub lv1_Click() On Error GoTo e:

Call OpenTable("SELECT * FROM [bagian] WHERE kd_bag='" & lv1.ListItems.Item(lv1.SelectedItem.Index).Text & "'", rsRS)

With rsRS

If Not .EOF Then Me.cbokd_bag.Text = .Fields("kd_bag") Me.txt_nm_bag.Text = .Fields("nm_bag") End If End With e: Exit Sub End Sub

Private Sub Timer1_Timer() Bar1.Value = Bar1.Value + 10 Me.Label9.Caption = Bar1.Value If Bar1.Value = 100 Then

Desy Masraudha : Sistem Informasi Kepegawaian Pada Dinas Pekerjaan Umum Kabupaten Asahan Menggunakan Visual Basic 6.0, 2008. USU Repository © 2009 Frame3.Visible = False Bar1.Value = 0 PesanSimpan frmEBagian End If End Sub Sub Perbaiki()

SQLHapus = "DELETE FROM [bagian] WHERE kd_bag='" & Me.cbokd_bag.Text & "'"

Conn.Execute (SQLHapus)

SQlSimpan = "INSERT INTO bagian VALUES('" & Me.cbokd_bag.Text & "'," & _ "'" & Me.txt_nm_bag.Text & "'," & _

"'" & txt_divisi.Text & "');"

Conn.Execute (SQlSimpan) End Sub

Form Edit Biodata Pegawai

Private Sub cbokd_bag_Change() cbokd_bag_Click

End Sub

Private Sub cbokd_bag_Click()

Call OpenTable("SELECT * FROM [bagian] WHERE kd_bag='" & Me.cbokd_bag.Text & "'", rsRS)

With rsRS

If Not .EOF Then Me.txt_nm_bag.Text = .Fields("nm_bag") Me.txt_divisi.Text = .Fields("divisi") End If End With End Sub

Desy Masraudha : Sistem Informasi Kepegawaian Pada Dinas Pekerjaan Umum Kabupaten Asahan Menggunakan Visual Basic 6.0, 2008. USU Repository © 2009 Call CleanControls Me.cbonip.SetFocus cbonip.Text = "" End Sub

Private Sub CmdKeluar_Click() Unload Me

End Sub

Private Sub CmdSimpan_Click() If Me.cbonip.Text <> "" Then Call Perbaiki cmdBatal_Click

Call LoadDataToListView("SELECT * FROM [qbiodata]", rsRS, lv1, 18) Frame3.Visible = True Timer1.Enabled = True Else PesanKosong frmEPegawai Exit Sub End If End Sub

Private Sub Form_Activate() Me.cbonip.SetFocus

End Sub

Private Sub Form_KeyPress(KeyAscii As Integer) If KeyAscii = 27 Then

Unload Me

ElseIf KeyAscii = 13 Then SendKeys "{Tab}" End If

Desy Masraudha : Sistem Informasi Kepegawaian Pada Dinas Pekerjaan Umum Kabupaten Asahan Menggunakan Visual Basic 6.0, 2008.

USU Repository © 2009

End Sub

Private Sub Form_Load()

Call LoadDataToListView("SELECT * FROM [qbiodata]", rsRS, lv1, 18) Call SetFormCenter(Me)

Call LoadnipToCombo("SELECT*FROM biodata", rsRS, Me.cbonip) Call Loadkd_bagToCombo("SELECT*FROM bagian", rsRS, Me.cbokd_bag)

Call SetFormCenter(Me)

End Sub

Private Sub CleanControls() For Each txt In Me.Controls If TypeOf txt Is TextBox Then txt.Text = ""

ElseIf TypeOf txt Is ComboBox Then txt.ListIndex = -1

End If Next

Me.cbonip.Text = "" End Sub

Private Sub cbonip_Change() cbonip_Click

End Sub

Private Sub cbonip_Click()

Call OpenTable("SELECT * FROM [biodata] WHERE nip='" & Me.cbonip.Text & "'", rsRS)

With rsRS

If Not .EOF Then Me.txt_nm_peg.Text = .Fields("nm_peg") Me.cbo_jenkel.Text = .Fields("jenkel") Me.dt_tgl_lahir.Value = .Fields("tgl_lahir") Me.txt_t_lahir = .Fields("t_lahir") Me.cbo_agama.Text = .Fields("agama") Me.dt_tgl_angkat.Value = .Fields("tgl_angkat") Me.cbo_pendidikan.Text = .Fields("pendidikan") Me.txt_jabatan.Text = .Fields("jabatan")

Desy Masraudha : Sistem Informasi Kepegawaian Pada Dinas Pekerjaan Umum Kabupaten Asahan Menggunakan Visual Basic 6.0, 2008. USU Repository © 2009 Me.cbokd_bag.Text = .Fields("kd_bag") End If End With End Sub

Private Sub cbonip_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then

cbonip_Click

End If End Sub

Private Sub lv1_Click() On Error GoTo e:

Call OpenTable("SELECT * FROM [biodata] WHERE nip='" & lv1.ListItems.Item(lv1.SelectedItem.Index).Text & "'", rsRS)

With rsRS

If Not .EOF Then Me.cbonip.Text = .Fields("nip") Me.txt_nm_peg.Text = .Fields("nm_peg") Me.cbo_jenkel.Text = .Fields("jenkel") Me.dt_tgl_lahir.Value = .Fields("tgl_lahir") Me.txt_t_lahir = .Fields("t_lahir") Me.cbo_agama.Text = .Fields("agama") Me.dt_tgl_angkat.Value = .Fields("tgl_angkat") Me.cbo_pendidikan.Text = .Fields("pendidikan") Me.txt_jabatan.Text = .Fields("jabatan") Me.cbokd_bag.Text = .Fields("kd_bag") End If End With e: Exit Sub End Sub

Desy Masraudha : Sistem Informasi Kepegawaian Pada Dinas Pekerjaan Umum Kabupaten Asahan Menggunakan Visual Basic 6.0, 2008.

USU Repository © 2009

cthn = Year(Me.tgl_lahir.Value)

If Val(cthn) >= 1953 And Val(cthn) <= 1991 Then

Else

MsgBox "Pengisian tanggal lahir salah!", vbCritical, "Tanggal Lahir" Me.dttgl_lahir.SetFocus Exit Sub End If End Sub

Private Sub Timer1_Timer() Bar1.Value = Bar1.Value + 10 Me.Label9.Caption = Bar1.Value If Bar1.Value = 100 Then Timer1.Enabled = False Frame3.Visible = False Bar1.Value = 0 PesanSimpan frmEPegawai End If End Sub Sub Perbaiki()

SQLHapus = "DELETE FROM [biodata] WHERE nip='" & Me.cbonip.Text & "'" Conn.Execute (SQLHapus)

SQlSimpan = "INSERT INTO biodata VALUES('" & cbonip.Text & "'," & _ "'" & Me.txt_nm_peg.Text & "'," & _

"'" & Me.cbo_jenkel.Text & "'," & _ "'" & Me.dt_tgl_lahir.Value & "'," & _ "'" & Me.txt_t_lahir.Text & "'," & _ "'" & Me.cbo_agama.Text & "'," & _ "'" & Me.dt_tgl_angkat.Value & "'," & _ "'" & Me.cbo_pendidikan.Text & "'," & _ "'" & Me.cbokd_bag.Text & "'," & _ "'" & Me.txt_jabatan.Text & "');"

Conn.Execute (SQlSimpan)

End Sub

Desy Masraudha : Sistem Informasi Kepegawaian Pada Dinas Pekerjaan Umum Kabupaten Asahan Menggunakan Visual Basic 6.0, 2008.

USU Repository © 2009

Private Sub txt_nm_peg_KeyPress(KeyAscii As Integer) IsiDataText1

If InStr(Isitext, Chr(KeyAscii)) = 0 And KeyAscii <> vbKeyBack And KeyAscii <> vbKeyDelete And KeyAscii <> vbKeySpace Then

KeyAscii = 0 End If

End Sub

Form Edit Absensi Pegawai

Private Sub cmdBatal_Click() Call CleanControls

Me.cbonip.SetFocus cbonip.Text = "" End Sub

Private Sub CmdKeluar_Click() Unload Me

End Sub

Private Sub CmdSimpan_Click() If Me.cbonip.Text <> "" Then Call Perbaiki cmdBatal_Click

Call LoadDataToListView("SELECT * FROM [qabsensi]", rsRS, lv1, 18) Frame3.Visible = True Timer1.Enabled = True Else PesanKosong frmEPegawai Exit Sub

Desy Masraudha : Sistem Informasi Kepegawaian Pada Dinas Pekerjaan Umum Kabupaten Asahan Menggunakan Visual Basic 6.0, 2008. USU Repository © 2009 End If End Sub

Private Sub Form_Activate() Me.cbonip.SetFocus

End Sub

Private Sub Form_KeyPress(KeyAscii As Integer) If KeyAscii = 27 Then

Unload Me

ElseIf KeyAscii = 13 Then SendKeys "{Tab}" End If

End Sub

Private Sub Form_Load()

Call LoadDataToListView("SELECT * FROM [qabsensi]", rsRS, lv1, 18) Call SetFormCenter(Me)

Call LoadnipToCombo("SELECT*FROM biodata", rsRS, Me.cbonip)

Call SetFormCenter(Me)

End Sub

Private Sub CleanControls() For Each txt In Me.Controls If TypeOf txt Is TextBox Then txt.Text = ""

ElseIf TypeOf txt Is ComboBox Then txt.ListIndex = -1

End If Next

Me.cbonip.Text = "" End Sub

Private Sub cbonip_Change() cbonip_Click

Desy Masraudha : Sistem Informasi Kepegawaian Pada Dinas Pekerjaan Umum Kabupaten Asahan Menggunakan Visual Basic 6.0, 2008.

USU Repository © 2009

Private Sub cbonip_Click()

Call OpenTable("SELECT * FROM [biodata] WHERE nip='" & Me.cbonip.Text & "'", rsRS)

With rsRS

If Not .EOF Then Me.txt_nm_peg.Text = .Fields("nm_peg") End If End With End Sub

Private Sub cbonip_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then

cbonip_Click End If

End Sub

Private Sub lv1_Click() 'On Error GoTo e:

Call OpenTable("SELECT * FROM [absensi] WHERE id=" & lv1.ListItems.Item(lv1.SelectedItem.Index).Text & "", rsRS)

With rsRS

If Not .EOF Then Me.Text1.Text = .Fields("id") Me.cbonip.Text = .Fields("nip") Me.dt_tgl_abs.Value = .Fields("tgl_abs") Me.cbo_keterangan.Text = .Fields("keterangan") End If End With 'e: 'Exit Sub End Sub

Private Sub Timer1_Timer() Bar1.Value = Bar1.Value + 10 Me.Label9.Caption = Bar1.Value

Desy Masraudha : Sistem Informasi Kepegawaian Pada Dinas Pekerjaan Umum Kabupaten Asahan Menggunakan Visual Basic 6.0, 2008. USU Repository © 2009 If Bar1.Value = 100 Then Timer1.Enabled = False Frame3.Visible = False Bar1.Value = 0 PesanSimpan frmEAbsensi End If End Sub Sub Perbaiki()

SQLPerbaiki = "UPDATE absensi SET nip ='" & Me.cbonip.Text & "'," & _ "tgl_abs ='" & Me.dt_tgl_abs.Value & "'," & _

"keterangan='" & Me.cbo_keterangan.Text & "' WHERE id = " & Me.Text1.Text & "" Conn.Execute (SQLPerbaiki) End Sub

Private Sub txt_nm_peg_KeyPress(KeyAscii As Integer) IsiDataText1

If InStr(Isitext, Chr(KeyAscii)) = 0 And KeyAscii <> vbKeyBack And KeyAscii <> vbKeyDelete And KeyAscii <> vbKeySpace Then

KeyAscii = 0 End If

End Sub

Form Hapus Data Bagian

Private Sub cmdBatal_Click() Call CleanControls

Me.cbokd_bag.SetFocus cbokd_bag.Text = "" End Sub

Desy Masraudha : Sistem Informasi Kepegawaian Pada Dinas Pekerjaan Umum Kabupaten Asahan Menggunakan Visual Basic 6.0, 2008.

USU Repository © 2009

Private Sub CmdKeluar_Click() Unload Me

End Sub

Private Sub CmdSimpan_Click()

Call OpenTable("SELECT * FROM [bagian] WHERE kd_bag='" & Me.cbokd_bag.Text & "'", rsRS)

With rsRS

If Not .EOF Then

reply = MsgBox("Data Akan Dihapus?", vbQuestion + vbYesNo, "Konfirmasi") If reply = vbYes Then

SQLHapus = "DELETE FROM [bagian] WHERE kd_bag='" & Me.cbokd_bag.Text & "'"

Conn.Execute (SQLHapus)

Call LoadDataToListView("SELECT * FROM [bagian]", rsRS, lv1, 10)

cmdBatal_Click

MsgBox "Data Dihapus!", vbInformation, "Hapus Data" End If

End If End With End Sub

Private Sub Form_Activate() Me.cbokd_bag.SetFocus End Sub

Private Sub Form_KeyPress(KeyAscii As Integer) If KeyAscii = 27 Then

Unload Me

ElseIf KeyAscii = 13 Then SendKeys "{Tab}" End If

End Sub

Desy Masraudha : Sistem Informasi Kepegawaian Pada Dinas Pekerjaan Umum Kabupaten Asahan Menggunakan Visual Basic 6.0, 2008.

USU Repository © 2009

Call LoadDataToListView("SELECT * FROM [bagian]", rsRS, lv1, 10) Call SetFormCenter(Me)

Call Loadkd_bagToCombo("SELECT*FROM bagian", rsRS, Me.cbokd_bag) Call SetFormCenter(Me)

End Sub

Private Sub CleanControls() For Each txt In Me.Controls If TypeOf txt Is TextBox Then txt.Text = ""

ElseIf TypeOf txt Is ComboBox Then txt.ListIndex = -1

End If Next

cbokd_bag.Text = "" End Sub

Private Sub cbokd_bag_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then

cbokd_bag_Click

End If End Sub

Private Sub lv1_Click() On Error GoTo e:

Call OpenTable("SELECT * FROM [bagian] WHERE kd_bag='" & lv1.ListItems.Item(lv1.SelectedItem.Index).Text & "'", rsRS)

With rsRS

If Not .EOF Then Me.cbokd_bag.Text = .Fields("kd_bag") Me.txt_nm_bag.Text = .Fields("nm_bag") Me.txt_divisi.Text = .Fields("divisi") End If End With e: Exit Sub

Desy Masraudha : Sistem Informasi Kepegawaian Pada Dinas Pekerjaan Umum Kabupaten Asahan Menggunakan Visual Basic 6.0, 2008.

USU Repository © 2009

End Sub

Private Sub cbokd_bag_Change() cbokd_bag_Click

End Sub

Private Sub cbokd_bag_Click()

Call OpenTable("SELECT * FROM [bagian] WHERE kd_bag='" & Me.cbokd_bag.Text & "'", rsRS)

With rsRS

If Not .EOF Then Me.txt_nm_bag.Text = .Fields("nm_bag") Me.txt_divisi.Text = .Fields("divisi") End If End With End Sub

Private Sub Timer1_Timer() Bar1.Value = Bar1.Value + 10 Me.Label9.Caption = Bar1.Value If Bar1.Value = 100 Then Timer1.Enabled = False Frame3.Visible = False Bar1.Value = 0 PesanSimpan frmHBagian End If End Sub Sub Perbaiki()

SQLHapus = "DELETE FROM [bagian] WHERE kd_bag='" & Me.cbokd_bag.Text & "'"

Conn.Execute (SQLHapus)

End Sub

Desy Masraudha : Sistem Informasi Kepegawaian Pada Dinas Pekerjaan Umum Kabupaten Asahan Menggunakan Visual Basic 6.0, 2008.

USU Repository © 2009

Form Hapus Biodata Pegawai

Private Sub cbokd_bag_Change() cbokd_bag_Click

End Sub

Private Sub cbokd_bag_Click()

Dokumen terkait