Sunteți pe pagina 1din 20

Listing Script Program

Form Login Imports System.Data.OleDb Public Class Login Sub Kosongkan() TxtUser.Text = "" TxtPass.Text = "" TxtUser.Focus() End Sub Private Sub Login_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Call Koneksi() Call Kosongkan() End Sub Private Sub BtnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnCancel.Click End End Sub Private Sub BtnMasuk_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnMasuk.Click Koneksi() cmd = New OleDbCommand("select * from TabelUser where User='" & TxtUser.Text & "' and Password='" & TxtPass.Text & "'", Conn) rd = cmd.ExecuteReader rd.Read() If rd.HasRows Then Me.Visible = False MenuUtama.Show() MenuUtama.UserStatusLabel.Text = rd.GetString(1) If MenuUtama.UserStatusLabel.Text <> "admin" Then MenuUtama.FileToolStripMenuItem.Enabled = False Else MenuUtama.FileToolStripMenuItem.Enabled = True End If Else MsgBox("Login Salah!!!") TxtUser.Focus() End If End Sub End Class

Form Menu Utama Public Class MenuUtama Sub TampilBulan() Dim bln As String = "" bln = Format(Today, "MM") If bln = "01" Then BulanStatusLabel.Text = "Januari" ElseIf bln = "02" Then BulanStatusLabel.Text = "Februari" ElseIf bln = "03" Then BulanStatusLabel.Text = "Maret" ElseIf bln = "04" Then BulanStatusLabel.Text = "April" ElseIf bln = "05" Then BulanStatusLabel.Text = "Mei" ElseIf bln = "06" Then BulanStatusLabel.Text = "Juni" ElseIf bln = "07" Then BulanStatusLabel.Text = "Juli" ElseIf bln = "08" Then BulanStatusLabel.Text = "Agustus" ElseIf bln = "09" Then BulanStatusLabel.Text = "September" ElseIf bln = "10" Then BulanStatusLabel.Text = "Oktober" ElseIf bln = "11" Then BulanStatusLabel.Text = "November" ElseIf bln = "12" Then BulanStatusLabel.Text = "Desember" End If End Sub Private Sub MenuUtama_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Call TampilBulan() TahunStatusLabel.Text = Format(Today, "yyyy") End Sub Private Sub PegawaiToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PegawaiToolStripMenuItem.Click Pegawai.Show() End Sub Private Sub JabatanToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles JabatanToolStripMenuItem.Click Jabatan.Show() End Sub

Private Sub PotonganToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PotonganToolStripMenuItem.Click Potongan.Show() End Sub Private Sub HitungGajiToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles HitungGajiToolStripMenuItem.Click HitungGaji.Show() End Sub Private Sub CetakSlipToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CetakSlipToolStripMenuItem.Click CetakSlip.Show() End Sub Private Sub LaporanToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LaporanToolStripMenuItem.Click Laporan.Show() End Sub Private Sub KeluarToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles KeluarToolStripMenuItem.Click End End Sub End Class

Form Menu Pegawai Imports System.Data.OleDb Public Class Pegawai Sub Kosongkan() TxtNIP.Text = "" TxtNamaPegawai.Text = "" ComboJabatan.Text = "" TxtNIP.Focus() End Sub Sub TampilDGV() Dim ODV As New DataView da = New OleDbDataAdapter("select NIP as [NIP],Nama_Pegawai as [Nama Pegawai],Jabatan as [Jabatan] from Pegawai", Conn) ds = New DataSet ds.Clear() da.Fill(ds, "Pegawai") DGV.DataSource = (ds.Tables("Pegawai")) DGV.ReadOnly = True DGV.Columns("NIP").Width = 100 DGV.Columns("Nama Pegawai").Width = 150 DGV.Columns("Jabatan").Width = 150 ODV = New DataView(ds.Tables("Pegawai")) DGV.DataSource = ODV ODV.Sort = "NIP ASC" End Sub Sub TampilJabatan() cmd = New OleDbCommand("select * from Jabatan", Conn) rd = cmd.ExecuteReader ComboJabatan.Items.Clear() Do While rd.Read ComboJabatan.Items.Add(rd.Item(1)) Loop End Sub Private Sub Pegawai_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Call Koneksi() Call Kosongkan() Call TampilJabatan() Call TampilDGV() End Sub Private Sub BtnSimpan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnSimpan.Click If TxtNIP.Text = "" Or TxtNamaPegawai.Text = "" Or ComboJabatan.Text = "" Then MsgBox("Data Belum Lengkap") Exit Sub Else

cmd = New OleDbCommand("Select * from Pegawai where NIP='" & TxtNIP.Text & "'", Conn) rd = cmd.ExecuteReader rd.Read() If Not rd.HasRows Then Dim sqltambah As String = "Insert into Pegawai(NIP,Nama_Pegawai,Jabatan) values " & _ "('" & TxtNIP.Text & "','" & TxtNamaPegawai.Text & "','" & ComboJabatan.Text & "')" cmd = New OleDbCommand(sqltambah, Conn) cmd.ExecuteNonQuery() Call Kosongkan() Call TampilJabatan() Call TampilDGV() End If End If End Sub Private Sub BtnHapus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnHapus.Click cmd = New OleDbCommand("Select * from Pegawai where NIP='" & TxtNIP.Text & "'", Conn) rd = cmd.ExecuteReader rd.Read() If Not rd.HasRows Then MsgBox("Isi NIP Yang Mau Dihapus") TxtNIP.Focus() Exit Sub Else If MessageBox.Show("Yakin Akan Dihapus..?", "", MessageBoxButtons.YesNo) = Windows.Forms.DialogResult.Yes Then cmd = New OleDbCommand("Delete * from Pegawai where NIP='" & TxtNIP.Text & "'", Conn) cmd.ExecuteNonQuery() Call Kosongkan() Call TampilJabatan() Call TampilDGV() End If End If End Sub Private Sub BtnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnClear.Click Call Kosongkan() Call TampilJabatan() Call TampilDGV() End Sub End Class

Form Menu Jabatan

Imports System.Data.OleDb Public Class Jabatan Sub Kosongkan() TxtKodeJabatan.Text = "" TxtJabatan.Text = "" TxtGapok.Text = "" TxtTjTransport.Text = "" TxtTjKomunikasi.Text = "" TxtKodeJabatan.Focus() End Sub Sub TampilDGV() Dim ODV As New DataView da = New OleDbDataAdapter("select Kode_Jabatan as [Kode],Jabatan as [Jabatan],Gaji_Pokok as [Gaji Pokok],Tj_Transport as [Tunjangan Transport],Tj_Komunikasi as [Tunjangan Komunikasi] from Jabatan", Conn) ds = New DataSet ds.Clear() da.Fill(ds, "Jabatan") DGV.DataSource = (ds.Tables("Jabatan")) DGV.ReadOnly = True DGV.Columns("Kode").Width = 100 DGV.Columns("Jabatan").Width = 150 DGV.Columns("Gaji Pokok").Width = 150 DGV.Columns("Tunjangan Transport").Width = 160 DGV.Columns("Tunjangan Komunikasi").Width = 160 ODV = New DataView(ds.Tables("Jabatan")) DGV.DataSource = ODV ODV.Sort = "Kode ASC" End Sub Private Sub Jabatan_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Call Koneksi() Call Kosongkan() Call TampilDGV() End Sub Private Sub BtnSimpan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnSimpan.Click If TxtKodeJabatan.Text = "" Or TxtJabatan.Text = "" Or TxtGapok.Text = "" Or TxtTjTransport.Text = "" Or TxtTjKomunikasi.Text = "" Then MsgBox("Data Belum Lengkap") Exit Sub Else cmd = New OleDbCommand("Select * from Jabatan where Kode_Jabatan='" & TxtKodeJabatan.Text & "'", Conn) rd = cmd.ExecuteReader rd.Read()

If Not rd.HasRows Then Dim sqltambah As String = "Insert into Jabatan(Kode_Jabatan,Jabatan,Gaji_Pokok,Tj_Transport,Tj_Komunikasi) values " & _ "('" & TxtKodeJabatan.Text & "','" & TxtJabatan.Text & "','" & TxtGapok.Text & "','" & TxtTjTransport.Text & "','" & TxtTjKomunikasi.Text & "')" cmd = New OleDbCommand(sqltambah, Conn) cmd.ExecuteNonQuery() Call Kosongkan() Call TampilDGV() End If End If End Sub Private Sub BtnHapus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnHapus.Click cmd = New OleDbCommand("Select * from Jabatan where Kode_Jabatan='" & TxtKodeJabatan.Text & "'", Conn) rd = cmd.ExecuteReader rd.Read() If Not rd.HasRows Then MsgBox("Isi Kode Jabatan Yang Mau Dihapus") TxtKodeJabatan.Focus() Exit Sub Else If MessageBox.Show("Yakin Akan Dihapus..?", "", MessageBoxButtons.YesNo) = Windows.Forms.DialogResult.Yes Then cmd = New OleDbCommand("Delete * from Jabatan where Kode_Jabatan='" & TxtKodeJabatan.Text & "'", Conn) cmd.ExecuteNonQuery() Call Kosongkan() Call TampilDGV() End If End If End Sub Private Sub BtnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnClear.Click Call Kosongkan() Call TampilDGV() End Sub End Class

Form Menu Hitung Gaji

Imports System.Data.OleDb Public Class HitungGaji Sub TampilBulan() cmd = New OleDbCommand("select * from Bulan", Conn) rd = cmd.ExecuteReader ComboPeriode.Items.Clear() Do While rd.Read ComboPeriode.Items.Add(rd.Item(1)) Loop End Sub Sub AutoBulan() Dim bln As String = "" bln = Format(Today, "MM") If bln = "01" Then ComboPeriode.Text = "Januari" ElseIf bln = "02" Then ComboPeriode.Text = "Februari" ElseIf bln = "03" Then ComboPeriode.Text = "Maret" ElseIf bln = "04" Then ComboPeriode.Text = "April" ElseIf bln = "05" Then ComboPeriode.Text = "Mei" ElseIf bln = "06" Then ComboPeriode.Text = "Juni" ElseIf bln = "07" Then ComboPeriode.Text = "Juli" ElseIf bln = "08" Then ComboPeriode.Text = "Agustus" ElseIf bln = "09" Then ComboPeriode.Text = "September" ElseIf bln = "10" Then ComboPeriode.Text = "Oktober" ElseIf bln = "11" Then ComboPeriode.Text = "November" ElseIf bln = "12" Then ComboPeriode.Text = "Desember" End If End Sub Sub TampilPegawai() cmd = New OleDbCommand("select * from Pegawai", Conn) rd = cmd.ExecuteReader ComboNamaPegawai.Items.Clear() Do While rd.Read ComboNamaPegawai.Items.Add(rd.Item(1)) Loop

End Sub Sub TampilDGV1() da = New OleDbDataAdapter("Select Kode_Potongan as [Kode],Nama_Potongan as [Potongan] from Potongan ", Conn) ds = New DataSet ds.Clear() da.Fill(ds, "Potongan") DGV1.DataSource = (ds.Tables("Potongan")) DGV1.Columns.Add("Jumlah", "Jumlah") DGV1.Columns(0).ReadOnly = True DGV1.Columns(1).ReadOnly = True DGV1.Columns(0).Width = 50 DGV1.Columns(1).Width = 120 End Sub Sub TampilDGV2() Dim ODV As New DataView da = New OleDbDataAdapter("select NmrSlip as [Nomor Slip],PeriodeSlip as [Periode],TglSlip as [Tanggal],NIP as [NIP],JmlhHadir as [Jumlah Hadir],TotalTjTransport as [Total Tunjangan Transport],TotalPendapatan as [Total Pendapatan],PotAsuransi as [Asuransi],PotPinjaman as [Pinjaman],PotPPH as [Pajak],TotalPotongan as [Total Potongan],GajiBersih as [Gaji Bersih] from Gaji", Conn) ds = New DataSet ds.Clear() da.Fill(ds, "Gaji") DGV2.DataSource = (ds.Tables("Gaji")) DGV2.ReadOnly = True DGV2.Columns("Nomor Slip").Width = 100 DGV2.Columns("Periode").Width = 100 DGV2.Columns("Tanggal").Width = 100 DGV2.Columns("NIP").Width = 100 DGV2.Columns("Jumlah Hadir").Width = 100 DGV2.Columns("Total Tunjangan Transport").Width = 160 DGV2.Columns("Total Pendapatan").Width = 140 DGV2.Columns("Asuransi").Width = 120 DGV2.Columns("Pinjaman").Width = 120 DGV2.Columns("Pajak").Width = 120 DGV2.Columns("Total Potongan").Width = 140 DGV2.Columns("Gaji Bersih").Width = 160 ODV = New DataView(ds.Tables("Gaji")) DGV2.DataSource = ODV ODV.Sort = "Nomor Slip ASC" End Sub Sub AutoNumber() Dim strtemp As String = "" Dim strvalue As String = "" Dim sql As String

sql = "select * from Gaji ORDER BY NmrSlip DESC" cmd = New OleDbCommand(sql, Conn) rd = cmd.ExecuteReader If rd.Read Then strtemp = Mid(rd.Item("NmrSlip"), 8, 3) Else TxtNmrSlip.Text = "SG" + Format(Today, "MMyy") + "-" + TxtNIP.Text Exit Sub End If strvalue = Val(strtemp) + 1 TxtNmrSlip.Text = "SG" + Format(Today, "MMyy") + "-" + TxtNIP.Text End Sub Sub AmbilDataPegawai() cmd = New OleDbCommand("Select * from Pegawai where Nama_Pegawai='" & ComboNamaPegawai.Text & "'", Conn) rd = cmd.ExecuteReader rd.Read() If rd.HasRows = True Then TxtNIP.Text = rd.Item(0) TxtJabatan.Text = rd.Item(2) End If End Sub Sub AmbilDataJabatan() cmd = New OleDbCommand("Select * from Jabatan where Jabatan='" & TxtJabatan.Text & "'", Conn) rd = cmd.ExecuteReader rd.Read() If rd.HasRows = True Then TxtGapok.Text = rd.Item(2) TxtTjTransport.Text = rd.Item(3) TxtTjKomunikasi.Text = rd.Item(4) End If End Sub Sub Kosongkan() TxtTgl.Text = Today TxtNIP.Text = "" ComboNamaPegawai.Text = "" TxtJabatan.Text = "" TxtGapok.Text = "" TxtTjTransport.Text = "" TxtTjKomunikasi.Text = "" TxtJmlhHadir.Text = "" TxtTotalTjTransport.Text = "" TxtTotalPendapatan.Text = "" TxtTotalPotongan.Text = "" TxtGajiBersih.Text = ""

End Sub Sub BersihkanDGV1() DGV1.Columns.Clear() Call TampilDGV1() End Sub Private Sub HitungGaji_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Call Koneksi() Call Kosongkan() Call AutoNumber() Call TampilPegawai() Call AutoBulan() Call TampilDGV1() Call TampilDGV2() End Sub Private Sub ComboNamaPegawai_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboNamaPegawai.SelectedIndexChanged Call AmbilDataPegawai() Call AmbilDataJabatan() Call AutoNumber() End Sub Private Sub ComboNamaPegawai_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboNamaPegawai.Click Call Kosongkan() Call AutoNumber() Call TampilPegawai() Call AutoBulan() End Sub Private Sub TxtJmlhHadir_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TxtJmlhHadir.Click If ComboNamaPegawai.Text = "" Then MsgBox("Pilih Nama Pegawai Terlebih Dahulu") Exit Sub End If End Sub Private Sub TxtJmlhHadir_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TxtJmlhHadir.TextChanged TxtTotalTjTransport.Text = Val(TxtTjTransport.Text) * Val(TxtJmlhHadir.Text) TxtTotalPendapatan.Text = Val(TxtGapok.Text) + Val(TxtTjKomunikasi.Text) + Val(TxtTotalTjTransport.Text) End Sub Private Sub BtnEdit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnEdit.Click ComboPeriode.Enabled = True

Call TampilBulan() End Sub Private Sub ComboPeriode_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboPeriode.SelectedIndexChanged ComboPeriode.Enabled = False End Sub Private Sub DGV1_CellClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DGV1.CellClick If ComboNamaPegawai.Text = "" Or TxtJmlhHadir.Text = "" Then MsgBox("Pilih Nama Pegawai dan Isi Jumlah Hadir Terlebih Dahulu") Exit Sub End If End Sub Private Sub DGV1_CellEndEdit(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DGV1.CellEndEdit If e.ColumnIndex = 2 Then Call TotalPotong() TxtGajiBersih.Text = Val(TxtTotalPendapatan.Text) - Val(TxtTotalPotongan.Text) End If End Sub Sub TotalPotong() Dim Hitung As Integer = 0 For I As Integer = 0 To DGV1.Rows.Count - 1 Hitung = Hitung + Val(DGV1.Rows(I).Cells(2).Value) TxtTotalPotongan.Text = Hitung Next End Sub Private Sub BtnSimpan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnSimpan.Click If ComboNamaPegawai.Text = "" Or TxtJmlhHadir.Text = "" Or ComboPeriode.Text = "" Then MsgBox("Data Belum Lengkap") Exit Sub Else cmd = New OleDbCommand("Select * from Gaji where NmrSlip='" & TxtNmrSlip.Text & "'", Conn) rd = cmd.ExecuteReader rd.Read() If Not rd.HasRows Then Dim sqltambah As String = "Insert into Gaji(NmrSlip,PeriodeSlip,TglSlip,NIP,JmlhHadir,TotalTjTransport,TotalPendapatan,PotA suransi,PotPinjaman,PotPPH,TotalPotongan,GajiBersih) values " & _ "('" & TxtNmrSlip.Text & "','" & ComboPeriode.Text & "','" & TxtTgl.Text & "','" & TxtNIP.Text & "','" & TxtJmlhHadir.Text & "','" & TxtTotalTjTransport.Text & "','" & TxtTotalPendapatan.Text & "','" & DGV1.Rows(0).Cells(2).Value & "','" &

DGV1.Rows(1).Cells(2).Value & "','" & DGV1.Rows(2).Cells(2).Value & "','" & TxtTotalPotongan.Text & "','" & TxtGajiBersih.Text & "')" cmd = New OleDbCommand(sqltambah, Conn) cmd.ExecuteNonQuery() Call Kosongkan() Call BersihkanDGV1() Call TampilDGV2() Call TampilPegawai() Call AutoNumber() Call AutoBulan() End If End If End Sub Private Sub BtnHapus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnHapus.Click cmd = New OleDbCommand("Select * from Gaji where NmrSlip='" & TxtNmrSlip.Text & "'", Conn) rd = cmd.ExecuteReader rd.Read() If Not rd.HasRows Then MsgBox("Pilih Slip Gaji Terlebih Dahulu") TxtNmrSlip.Enabled = True TxtNIP.Text = "" TxtNIP.Focus() Exit Sub Else If MessageBox.Show("Yakin Akan Dihapus..?", "", MessageBoxButtons.YesNo) = Windows.Forms.DialogResult.Yes Then cmd = New OleDbCommand("Delete * from Gaji where NmrSlip='" & TxtNmrSlip.Text & "'", Conn) cmd.ExecuteNonQuery() Call Kosongkan() Call BersihkanDGV1() Call TampilDGV2() Call TampilPegawai() Call AutoNumber() Call AutoBulan() TxtNmrSlip.Enabled = False End If End If End Sub Private Sub BtnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnClear.Click Call Kosongkan() Call BersihkanDGV1() Call TampilDGV2()

Call TampilPegawai() Call AutoNumber() Call AutoBulan() TxtNmrSlip.Enabled = False End Sub End Class

Form Menu Cetak Slip

Imports System.Data.OleDb Public Class CetakSlip Sub AutoBulan() Dim bln As String = "" bln = Format(Today, "MM") If bln = "01" Then ComboPeriode.Text = "Januari" ElseIf bln = "02" Then ComboPeriode.Text = "Februari" ElseIf bln = "03" Then ComboPeriode.Text = "Maret" ElseIf bln = "04" Then ComboPeriode.Text = "April" ElseIf bln = "05" Then ComboPeriode.Text = "Mei" ElseIf bln = "06" Then ComboPeriode.Text = "Juni" ElseIf bln = "07" Then ComboPeriode.Text = "Juli" ElseIf bln = "08" Then ComboPeriode.Text = "Agustus" ElseIf bln = "09" Then ComboPeriode.Text = "September" ElseIf bln = "10" Then ComboPeriode.Text = "Oktober" ElseIf bln = "11" Then ComboPeriode.Text = "November" ElseIf bln = "12" Then ComboPeriode.Text = "Desember" End If End Sub Sub Kosongkan() ComboNmrSlip.Text = "" TxtNama.Text = "" End Sub Sub TampilNmrSlip() cmd = New OleDbCommand("select * from Gaji where PeriodeSlip='" & ComboPeriode.Text & "'", Conn) rd = cmd.ExecuteReader ComboNmrSlip.Items.Clear() Do While rd.Read ComboNmrSlip.Items.Add(rd.Item(0)) Loop End Sub Sub AmbilPegawai() Dim nomor As String = ""

cmd = New OleDbCommand("Select * from Gaji where NmrSlip='" & ComboNmrSlip.Text & "'", Conn) rd = cmd.ExecuteReader rd.Read() If rd.HasRows = True Then nomor = rd.Item(3) cmd = New OleDbCommand("Select * from Pegawai where NIP='" & nomor & "'", Conn) rd = cmd.ExecuteReader rd.Read() If rd.HasRows = True Then TxtNama.Text = rd.Item(1) End If End If End Sub Private Sub CetakSlip_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Call Koneksi() Call Kosongkan() Call AutoBulan() Call TampilNmrSlip() End Sub Sub TampilBulan() cmd = New OleDbCommand("select * from Bulan", Conn) rd = cmd.ExecuteReader ComboPeriode.Items.Clear() Do While rd.Read ComboPeriode.Items.Add(rd.Item(1)) Loop End Sub Private Sub ComboNmrSlip_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboNmrSlip.SelectedIndexChanged Call AmbilPegawai() End Sub Private Sub ComboNmrSlip_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboNmrSlip.Click Call Kosongkan() End Sub Private Sub BtnEdit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnEdit.Click ComboPeriode.Enabled = True Call TampilBulan() End Sub Private Sub ComboPeriode_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboPeriode.SelectedIndexChanged

ComboPeriode.Enabled = False End Sub Private Sub BtnCetak_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnCetak.Click FormCetakSlip.Show() FormCetakSlip.CRVSlipGaji.SelectionFormula = "{Q_Gaji.NmrSlip} = '" & ComboNmrSlip.Text & "'" FormCetakSlip.CRVSlipGaji.ReportSource = "SlipGaji.rpt" End Sub End Class

Form Menu Laporan Imports System.Data.OleDb

Public Class Laporan Sub AutoBulan() Dim bln As String = "" bln = Format(Today, "MM") If bln = "01" Then ComboPeriode.Text = "Januari" ElseIf bln = "02" Then ComboPeriode.Text = "Februari" ElseIf bln = "03" Then ComboPeriode.Text = "Maret" ElseIf bln = "04" Then ComboPeriode.Text = "April" ElseIf bln = "05" Then ComboPeriode.Text = "Mei" ElseIf bln = "06" Then ComboPeriode.Text = "Juni" ElseIf bln = "07" Then ComboPeriode.Text = "Juli" ElseIf bln = "08" Then ComboPeriode.Text = "Agustus" ElseIf bln = "09" Then ComboPeriode.Text = "September" ElseIf bln = "10" Then ComboPeriode.Text = "Oktober" ElseIf bln = "11" Then ComboPeriode.Text = "November" ElseIf bln = "12" Then ComboPeriode.Text = "Desember" End If End Sub Sub TampilBulan() cmd = New OleDbCommand("select * from Bulan", Conn) rd = cmd.ExecuteReader ComboPeriode.Items.Clear() Do While rd.Read ComboPeriode.Items.Add(rd.Item(1)) Loop End Sub Private Sub Laporan_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Call Koneksi() Call AutoBulan() End Sub Private Sub BtnEdit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnEdit.Click

ComboPeriode.Enabled = True Call TampilBulan() End Sub Private Sub ComboPeriode_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboPeriode.SelectedIndexChanged ComboPeriode.Enabled = False End Sub Private Sub BtnCetak_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnCetak.Click Report.Show() Report.CRVReport.SelectionFormula = "{Q_Gaji.PeriodeSlip} = '" & ComboPeriode.Text & "'" Report.CRVReport.ReportSource = "ReportGaji.rpt" End Sub End Class