Setelah kita melihat contoh proram aplikasi penggajian PT HOYAMA memakai visual basic 6.0, selanjutnya kita melihat form data karyawan.
Pada form penghitungan ini user hanya cukup menginput ID karyawan, jumlah jam lembur, jumlah shift2 dan 3, jumlah cuti, sakit, izin absen dalam satu bulan. Sisanya jadwal akan menghitung sendiri dan akan muncul hasil pendapatan dan pengeluaran selama satu bulan gaji.
Silahkan anda buat formnya dan beri name=formpenghitungan
Catatan :
A. Buat tabel grid
B. Masukkan komponen crystal report
C. Masukkan komponen timer
1. Buat Sub gres dengan nama sub aktif dan pastekan koding dibawah :
tidcounter.Enabled = True
tidkaryawan.Enabled = True
tnamakaryawan.Enabled = True
tjenisk.Enabled = True
ttglmsk.Enabled = True
tstatus.Enabled = True
tdivisi.Enabled = True
tdepartemen.Enabled = True
tjabatan.Enabled = True
ccuti.Enabled = True
tgolongan.Enabled = True
csakit.Enabled = True
tgajipokok.Enabled = True
tkehadiran.Enabled = True
tshift.Enabled = True
ttjabatan.Enabled = True
tanakistri.Enabled = True
ttranspor.Enabled = True
tpulsa.Enabled = True
tjhs2.Enabled = True
tjhs3.Enabled = True
tshift2.Enabled = True
tshift3.Enabled = True
tjamot.Enabled = True
tovertime.Enabled = True
tjpensiun.Enabled = True
tserikat.Enabled = True
cjim.Enabled = True
tim.Enabled = True
ctambah.Enabled = True
csimpan.Enabled = True
cbatal.Enabled = True
tidkaryawan.Enabled = True
tnamakaryawan.Enabled = True
tjenisk.Enabled = True
ttglmsk.Enabled = True
tstatus.Enabled = True
tdivisi.Enabled = True
tdepartemen.Enabled = True
tjabatan.Enabled = True
ccuti.Enabled = True
tgolongan.Enabled = True
csakit.Enabled = True
tgajipokok.Enabled = True
tkehadiran.Enabled = True
tshift.Enabled = True
ttjabatan.Enabled = True
tanakistri.Enabled = True
ttranspor.Enabled = True
tpulsa.Enabled = True
tjhs2.Enabled = True
tjhs3.Enabled = True
tshift2.Enabled = True
tshift3.Enabled = True
tjamot.Enabled = True
tovertime.Enabled = True
tjpensiun.Enabled = True
tserikat.Enabled = True
cjim.Enabled = True
tim.Enabled = True
ctambah.Enabled = True
csimpan.Enabled = True
cbatal.Enabled = True
2. Buat Sub gres dengan nama sub nonaktif dan pastekan koding dibawah :
tidcounter.Enabled = False
tidkaryawan.Enabled = False
tnamakaryawan.Enabled = False
tjenisk.Enabled = False
ttglmsk.Enabled = False
tstatus.Enabled = False
tdivisi.Enabled = False
tdepartemen.Enabled = False
tjabatan.Enabled = False
ccuti.Enabled = False
csakit.Enabled = False
tgajipokok.Enabled = False
tgolongan.Enabled = False
tkehadiran.Enabled = False
tshift.Enabled = False
ttjabatan.Enabled = False
tanakistri.Enabled = False
ttranspor.Enabled = False
tpulsa.Enabled = False
tjamot.Enabled = False
tovertime.Enabled = False
tjhs2.Enabled = False
tjhs3.Enabled = False
tshift2.Enabled = False
tshift3.Enabled = False
tjpensiun.Enabled = False
tserikat.Enabled = False
cjim.Enabled = False
tim.Enabled = False
ctambah.Enabled = False
csimpan.Enabled = False
cbatal.Enabled = False
tidkaryawan.Enabled = False
tnamakaryawan.Enabled = False
tjenisk.Enabled = False
ttglmsk.Enabled = False
tstatus.Enabled = False
tdivisi.Enabled = False
tdepartemen.Enabled = False
tjabatan.Enabled = False
ccuti.Enabled = False
csakit.Enabled = False
tgajipokok.Enabled = False
tgolongan.Enabled = False
tkehadiran.Enabled = False
tshift.Enabled = False
ttjabatan.Enabled = False
tanakistri.Enabled = False
ttranspor.Enabled = False
tpulsa.Enabled = False
tjamot.Enabled = False
tovertime.Enabled = False
tjhs2.Enabled = False
tjhs3.Enabled = False
tshift2.Enabled = False
tshift3.Enabled = False
tjpensiun.Enabled = False
tserikat.Enabled = False
cjim.Enabled = False
tim.Enabled = False
ctambah.Enabled = False
csimpan.Enabled = False
cbatal.Enabled = False
3. Buat Sub gres dengan nama sub higienis dan pastekan koding dibawah :
tidcounter.Text = ""
tidkaryawan.Text = ""
tnamakaryawan.Text = ""
tjenisk.Text = ""
tgolongan.Text = ""
ttglmsk.Text = ""
tstatus.Text = ""
tdivisi.Text = ""
tdepartemen.Text = ""
tjabatan.Text = ""
ccuti.Text = "0"
csakit.Text = ""
tgajipokok.Text = "0"
tkehadiran.Text = "0"
tshift.Text = "0"
ttjabatan.Text = "0"
tanakistri.Text = "0"
ttranspor.Text = "0"
tpulsa.Text = "0"
tjamot.Text = "0"
tjhs2.Text = "0"
tjhs3.Text = "0"
tshift2.Text = "0"
tshift3.Text = "0"
tovertime.Text = "0"
tjpensiun.Text = "0"
tserikat.Text = "0"
cjim.Text = ""
tim.Text = "0"
tidkaryawan.Text = ""
tnamakaryawan.Text = ""
tjenisk.Text = ""
tgolongan.Text = ""
ttglmsk.Text = ""
tstatus.Text = ""
tdivisi.Text = ""
tdepartemen.Text = ""
tjabatan.Text = ""
ccuti.Text = "0"
csakit.Text = ""
tgajipokok.Text = "0"
tkehadiran.Text = "0"
tshift.Text = "0"
ttjabatan.Text = "0"
tanakistri.Text = "0"
ttranspor.Text = "0"
tpulsa.Text = "0"
tjamot.Text = "0"
tjhs2.Text = "0"
tjhs3.Text = "0"
tshift2.Text = "0"
tshift3.Text = "0"
tovertime.Text = "0"
tjpensiun.Text = "0"
tserikat.Text = "0"
cjim.Text = ""
tim.Text = "0"
4. Buat Sub gres dengan nama sub tampil dan pastekan koding dibawah :
Call koneksi
rspenghitungan.Open "select*from tabelpenghitungan", KON
Set grid1.DataSource = rspenghitungan
rspenghitungan.Open "select*from tabelpenghitungan", KON
Set grid1.DataSource = rspenghitungan
5. Buat Sub gres dengan nama sub ShiftYa dan pastekan koding dibawah :
tjhs2.Enabled = True
tjhs3.Enabled = True
tshift2.Enabled = True
tshift3.Enabled = True
tjhs3.Enabled = True
tshift2.Enabled = True
tshift3.Enabled = True
6. Buat Sub gres dengan nama sub nonshift dan pastekan koding dibawah :
tjhs2.Enabled = False
tjhs3.Enabled = False
tshift2.Enabled = False
tshift3.Enabled = False
tjhs3.Enabled = False
tshift2.Enabled = False
tshift3.Enabled = False
7. pastekan koding dibawah :
Private Sub Form_Load()
Me.Top = 100
Me.Left = 0
Me.Height = 8940
Me.Width = 20490
Call tampil
Call bersih
Call nonaktif
ctambah.Enabled = True
ccuti.Clear
For a = 0 To 5
ccuti.AddItem a
Next a
csakit.Clear
For b = 0 To 21
csakit.AddItem b
Next b
cjim.Clear
For c = 0 To 5
cjim.AddItem c
Next c
tpendapatan.Enabled = False
tpengurangan.Enabled = False
tgajiditerima.Enabled = False
kodeuser.Text = fmenu.StatusBar.Panels(2)
end sub
Me.Top = 100
Me.Left = 0
Me.Height = 8940
Me.Width = 20490
Call tampil
Call bersih
Call nonaktif
ctambah.Enabled = True
ccuti.Clear
For a = 0 To 5
ccuti.AddItem a
Next a
csakit.Clear
For b = 0 To 21
csakit.AddItem b
Next b
cjim.Clear
For c = 0 To 5
cjim.AddItem c
Next c
tpendapatan.Enabled = False
tpengurangan.Enabled = False
tgajiditerima.Enabled = False
kodeuser.Text = fmenu.StatusBar.Panels(2)
end sub
8. Buat Sub gres dengan nama sub panggildatakaryawan dan pastekan koding dibawah :
Call koneksi
If tstatus.Text = "YA" Then
Call koneksi
rsdatadasar.Open "select*from tabeldasar where kodedasar='" & kodedd.Text & "'", KON
tanakistri.Text = rsdatadasar.Fields("tanakistri")
Else
tanakistri.Text = "0"
tanakistri.Enabled = False
End If
Call koneksi
rsdatadasar.Open "select*from tabeldasar where kodedasar='" & kodedd.Text & "'", KON
tpulsa.Text = rsdatadasar.Fields("tpulsa")
transpor.Text = rsdatadasar.Fields("ttranspor")
ot.Text = rsdatadasar.Fields("overtime")
shift2.Text = rsdatadasar.Fields("tshift2")
shift3.Text = rsdatadasar.Fields("tshift3")
im.Text = rsdatadasar.Fields("izinmangkir")
tjpensiun.Text = rsdatadasar.Fields("jpensiun")
tserikat.Text = rsdatadasar.Fields("serikat")
tjpensiun.Text = Val(tgajipokok.Text) * Val(tjpensiun.Text) / 100
tserikat.Text = Val(tgajipokok.Text) * Val(tserikat.Text) / 100
tpulsa.Enabled = False
ccuti.Enabled = True
ccuti.SetFocus
'Call koneksi
'rspenghitungan.Open "select*from tabelpenghitungan where idkaryawan='" & tidkaryawan.Text & "'", KON
'bln.Text = rspenghitungan.Fields("tglinput")
'bln.Text = Mid(bln, 5, 3)
'If bln.Text = Val(tgl2.Text) Then
'MsgBox "Maaf Data Dengan ID yang Diinput Sudah Disimpan !", vbInformation
'Form_Load
'Else
'ccuti.SetFocus
If tstatus.Text = "YA" Then
Call koneksi
rsdatadasar.Open "select*from tabeldasar where kodedasar='" & kodedd.Text & "'", KON
tanakistri.Text = rsdatadasar.Fields("tanakistri")
Else
tanakistri.Text = "0"
tanakistri.Enabled = False
End If
Call koneksi
rsdatadasar.Open "select*from tabeldasar where kodedasar='" & kodedd.Text & "'", KON
tpulsa.Text = rsdatadasar.Fields("tpulsa")
transpor.Text = rsdatadasar.Fields("ttranspor")
ot.Text = rsdatadasar.Fields("overtime")
shift2.Text = rsdatadasar.Fields("tshift2")
shift3.Text = rsdatadasar.Fields("tshift3")
im.Text = rsdatadasar.Fields("izinmangkir")
tjpensiun.Text = rsdatadasar.Fields("jpensiun")
tserikat.Text = rsdatadasar.Fields("serikat")
tjpensiun.Text = Val(tgajipokok.Text) * Val(tjpensiun.Text) / 100
tserikat.Text = Val(tgajipokok.Text) * Val(tserikat.Text) / 100
tpulsa.Enabled = False
ccuti.Enabled = True
ccuti.SetFocus
'Call koneksi
'rspenghitungan.Open "select*from tabelpenghitungan where idkaryawan='" & tidkaryawan.Text & "'", KON
'bln.Text = rspenghitungan.Fields("tglinput")
'bln.Text = Mid(bln, 5, 3)
'If bln.Text = Val(tgl2.Text) Then
'MsgBox "Maaf Data Dengan ID yang Diinput Sudah Disimpan !", vbInformation
'Form_Load
'Else
'ccuti.SetFocus
9. Buat Sub gres dengan nama sub panggilshift dan pastekan koding dibawah :
If shift.Text = "SHIFT" Then
tjhs2.Enabled = True
tjhs3.Enabled = True
tjhs2.SetFocus
Else
tjhs2.Enabled = False
tjhs3.Enabled = False
cjim.Enabled = True
cjim.SetFocus
End If
tjhs2.Enabled = True
tjhs3.Enabled = True
tjhs2.SetFocus
Else
tjhs2.Enabled = False
tjhs3.Enabled = False
cjim.Enabled = True
cjim.SetFocus
End If
10.Double lklik pada timer dan pastekan koding dibawah :
tjam.Text = Time
tgl.Text = Format(Date, "yyyy-mm-dd")
tgl2.Text = Format(Date, "-mm")
tgl.Text = Format(Date, "yyyy-mm-dd")
tgl2.Text = Format(Date, "-mm")
11. Double klik pada tidkaryawan dan pastekan koding dibawah (declaration=keypress) :
If KeyAscii = 13 Then
Call koneksi
rsdatakaryawan.Open "select*from tabelkaryawan where idkaryawan='" & tidkaryawan.Text & "'", KON
With rsdatakaryawan
If rsdatakaryawan.EOF Then
MsgBox "ID tidak ditemukan", vbCritical
tidkaryawan.Text = ""
Else
tidkaryawan = UCase(tidkaryawan)
tnamakaryawan.Text = rsdatakaryawan.Fields("namakaryawan")
tjenisk.Text = rsdatakaryawan.Fields("jeniskelamin")
tnamakaryawan.Text = rsdatakaryawan.Fields("namakaryawan")
ttglmsk.Text = rsdatakaryawan.Fields("tglmasuk")
tstatus.Text = rsdatakaryawan.Fields("status")
tdivisi.Text = rsdatakaryawan.Fields("divisi")
tdepartemen.Text = rsdatakaryawan.Fields("departemen")
tjabatan.Text = rsdatakaryawan.Fields("jabatan")
ttjabatan.Text = rsdatakaryawan.Fields("tjabatan")
tgajipokok.Text = rsdatakaryawan.Fields("gajipokok")
tgolongan.Text = rsdatakaryawan.Fields("golongan")
tserikat2.Text = rsdatakaryawan.Fields("serikat")
shift.Text = rsdatakaryawan.Fields("shift")
kodedd.Text = rsdatakaryawan.Fields("kodedasar")
tcuti.Text = rsdatakaryawan.Fields("cuti")
tnamakaryawan.Enabled = False
tjenisk.Enabled = False
tnamakaryawan.Enabled = False
ttglmsk.Enabled = False
tstatus.Enabled = False
tdivisi.Enabled = False
tdepartemen.Enabled = False
tjabatan.Enabled = False
ttjabatan.Enabled = False
ttranspor.Enabled = False
tjpensiun.Enabled = False
tserikat.Enabled = False
tkehadiran.Enabled = False
tgajipokok.Enabled = False
tgolongan.Enabled = False
tserikat2.Enabled = False
tidkaryawan.Enabled = False
Call panggildatakaryawan
End If
End With
End If
Call koneksi
rsdatakaryawan.Open "select*from tabelkaryawan where idkaryawan='" & tidkaryawan.Text & "'", KON
With rsdatakaryawan
If rsdatakaryawan.EOF Then
MsgBox "ID tidak ditemukan", vbCritical
tidkaryawan.Text = ""
Else
tidkaryawan = UCase(tidkaryawan)
tnamakaryawan.Text = rsdatakaryawan.Fields("namakaryawan")
tjenisk.Text = rsdatakaryawan.Fields("jeniskelamin")
tnamakaryawan.Text = rsdatakaryawan.Fields("namakaryawan")
ttglmsk.Text = rsdatakaryawan.Fields("tglmasuk")
tstatus.Text = rsdatakaryawan.Fields("status")
tdivisi.Text = rsdatakaryawan.Fields("divisi")
tdepartemen.Text = rsdatakaryawan.Fields("departemen")
tjabatan.Text = rsdatakaryawan.Fields("jabatan")
ttjabatan.Text = rsdatakaryawan.Fields("tjabatan")
tgajipokok.Text = rsdatakaryawan.Fields("gajipokok")
tgolongan.Text = rsdatakaryawan.Fields("golongan")
tserikat2.Text = rsdatakaryawan.Fields("serikat")
shift.Text = rsdatakaryawan.Fields("shift")
kodedd.Text = rsdatakaryawan.Fields("kodedasar")
tcuti.Text = rsdatakaryawan.Fields("cuti")
tnamakaryawan.Enabled = False
tjenisk.Enabled = False
tnamakaryawan.Enabled = False
ttglmsk.Enabled = False
tstatus.Enabled = False
tdivisi.Enabled = False
tdepartemen.Enabled = False
tjabatan.Enabled = False
ttjabatan.Enabled = False
ttranspor.Enabled = False
tjpensiun.Enabled = False
tserikat.Enabled = False
tkehadiran.Enabled = False
tgajipokok.Enabled = False
tgolongan.Enabled = False
tserikat2.Enabled = False
tidkaryawan.Enabled = False
Call panggildatakaryawan
End If
End With
End If
12. Double klik pada ccuti dan pastekan koding dibawah (declaration=click) :
sisacuti.Text = Val(tcuti.Text) - Val(ccuti.Text)
If sisacuti.Text < 0 Then
MsgBox "Maaf Hak Cuti Habis", vbCritical
ccuti.SetFocus
Else
csakit.Enabled = True
csakit.SetFocus
End If
If sisacuti.Text < 0 Then
MsgBox "Maaf Hak Cuti Habis", vbCritical
ccuti.SetFocus
Else
csakit.Enabled = True
csakit.SetFocus
End If
13. Double klik pada csakit dan pastekan koding dibawah (declaration=click) :
If csakit.Text = "0" Then
Call koneksi
rsdatadasar.Open "select*from tabeldasar where kodedasar='" & kodedd.Text & "'", KON
tkehadiran.Text = rsdatadasar.Fields("tkehadiran")
ttranspor.Text = Val(transpor.Text) * 21
Else
tkehadiran.Text = "0"
d = 21 - Val(csakit.Text)
ttranspor.Text = Val(transpor.Text) * d
End If
tjamot.Enabled = True
cjim.Enabled = True
If shift.Text = "SHIFT" Then
Call shiftya
Else
Call nonshift
tjamot.SetFocus
End If
Call koneksi
rsdatadasar.Open "select*from tabeldasar where kodedasar='" & kodedd.Text & "'", KON
tkehadiran.Text = rsdatadasar.Fields("tkehadiran")
ttranspor.Text = Val(transpor.Text) * 21
Else
tkehadiran.Text = "0"
d = 21 - Val(csakit.Text)
ttranspor.Text = Val(transpor.Text) * d
End If
tjamot.Enabled = True
cjim.Enabled = True
If shift.Text = "SHIFT" Then
Call shiftya
Else
Call nonshift
tjamot.SetFocus
End If
14. Double klik pada tjamot dan pastekan koding dibawah (declaration=keypress) :
If KeyAscii = 13 Then
tovertime.Text = Val(tjamot.Text) * Val(ot.Text)
tovertime.Enabled = False
Else
tovertime.Enabled = False
End If
Call panggilshift
tovertime.Text = Val(tjamot.Text) * Val(ot.Text)
tovertime.Enabled = False
Else
tovertime.Enabled = False
End If
Call panggilshift
15. Double klik pada tjhs2 dan pastekan koding dibawah (declaration=keypress) :
If KeyAscii = 13 Then
tshift2.Text = Val(tjhs2.Text) * Val(shift2.Text)
tshift2.Enabled = False
tjhs3.SetFocus
End If
tshift2.Text = Val(tjhs2.Text) * Val(shift2.Text)
tshift2.Enabled = False
tjhs3.SetFocus
End If
16. Double klik pada tjhs3 dan pastekan koding dibawah (declaration=keypress) :
If KeyAscii = 13 Then
tshift3.Text = Val(tjhs3.Text) * Val(shift3.Text)
tshift3.Enabled = False
cjim.Enabled = True
cjim.SetFocus
tjshift.Text = Val(shift2.Text) + Val(shift3.Text)
End If
tshift3.Text = Val(tjhs3.Text) * Val(shift3.Text)
tshift3.Enabled = False
cjim.Enabled = True
cjim.SetFocus
tjshift.Text = Val(shift2.Text) + Val(shift3.Text)
End If
17. Double klik pada cjim dan pastekan koding dibawah (declaration=ckick) :
tim.Text = Val(cjim.Text) * Val(im.Text)
tim.Enabled = False
If tim.Text = "0" And csakit.Text = "0" Then
tkehadiran.Text = 21 * Val(transpor.Text)
Else
tkehadiran.Text = "0"
e = 21 - Val(csakit.Text) - Val(cjim.Text)
ttranspor.Text = Val(transpor.Text) * e
End If
tpendapatan.Text = Val(tgajipokok.Text) + Val(tkehadiran.Text) + Val(ttjabatan.Text) + Val(tanakistri.Text) + Val(ttranspor.Text) + Val(tpulsa.Text) + Val(tovertime.Text) + Val(tshift2.Text) + Val(tshift3.Text)
tpengurangan.Text = Val(tjpensiun.Text) + Val(tserikat.Text) + Val(tim.Text)
tgajiditerima.Text = Val(tpendapatan.Text) - Val(tpengurangan.Text)
csimpan.Enabled = True
tim.Enabled = False
If tim.Text = "0" And csakit.Text = "0" Then
tkehadiran.Text = 21 * Val(transpor.Text)
Else
tkehadiran.Text = "0"
e = 21 - Val(csakit.Text) - Val(cjim.Text)
ttranspor.Text = Val(transpor.Text) * e
End If
tpendapatan.Text = Val(tgajipokok.Text) + Val(tkehadiran.Text) + Val(ttjabatan.Text) + Val(tanakistri.Text) + Val(ttranspor.Text) + Val(tpulsa.Text) + Val(tovertime.Text) + Val(tshift2.Text) + Val(tshift3.Text)
tpengurangan.Text = Val(tjpensiun.Text) + Val(tserikat.Text) + Val(tim.Text)
tgajiditerima.Text = Val(tpendapatan.Text) - Val(tpengurangan.Text)
csimpan.Enabled = True
18. Double klik pada ctambah dan pastekan koding dibawah (declaration=click) :
Call koneksi
Call bersih
tidkaryawan.Enabled = True
rspenghitungan.Open "select*from tabelpenghitungan order by idcounter desc", KON
With rspenghitungan
If .BOF And .EOF Then
tidcounter.Text = "SG" + Format(Date, "YYMM") + "0001"
Else
tidcounter.Text = "SG" + Format(Date, "YYMM") + Right(Str(Val(Right(.Fields("idcounter"), 4)) + 10001), 4)
End If
End With
tidkaryawan.SetFocus
tidcounter.Enabled = False
ctambah.Enabled = False
cbatal.Enabled = True
Call tampil
Call bersih
tidkaryawan.Enabled = True
rspenghitungan.Open "select*from tabelpenghitungan order by idcounter desc", KON
With rspenghitungan
If .BOF And .EOF Then
tidcounter.Text = "SG" + Format(Date, "YYMM") + "0001"
Else
tidcounter.Text = "SG" + Format(Date, "YYMM") + Right(Str(Val(Right(.Fields("idcounter"), 4)) + 10001), 4)
End If
End With
tidkaryawan.SetFocus
tidcounter.Enabled = False
ctambah.Enabled = False
cbatal.Enabled = True
Call tampil
19. Double klik pada csimpan dan pastekan koding dibawah (declaration=click) :
If ccuti.Text = "" Or csakit.Text = "" Or cjim.Text = "" Then
MsgBox "Data Belum terisi semua", vbCritical
Else
Call koneksi
rspenghitungan.Open "insert into tabelpenghitungan values('" & tidcounter & "','" & tidkaryawan & "','" & tnamakaryawan & "','" & tjenisk & "','" & ttglmsk & "','" & tstatus & "','" & tdivisi & "','" & tdepartemen & "','" & tjabatan & "','" & ccuti & "','" & csakit & "','" & tgajipokok & "','" & tkehadiran & "','" & tjshift & "','" & ttjabatan & "','" & tanakistri & "','" & ttranspor & "','" & tpulsa & "','" & tjamot & "','" & tovertime & "','" & tpendapatan & "','" & tjpensiun & "','" & tserikat & "','" & cjim & "','" & tim & "','" & tpengurangan & "','" & tgajiditerima & "','" & tgl & "','" & kodedd & "','" & kodeuser & "')", KON
MsgBox "Data Sudah Tersimpan", vbInformation
cr.SelectionFormula = "Totext({tabelpenghitungan.idcounter})= '" & tidcounter.Text & "'"
cr.ReportFileName = "D:\Belajar MVB\slipgajikaryawan.rpt"
cr.WindowState = crptMaximized
cr.RetrieveDataFiles
cr.Action = 1
Call tampil
Call bersih
Call nonaktif
ctambah.Enabled = True
Call koneksi
rsdatakaryawan.Open "update tabelkaryawan set cuti='" & sisacuti & "' where kodedasar='" & kodedd & "'", KON
End If
MsgBox "Data Belum terisi semua", vbCritical
Else
Call koneksi
rspenghitungan.Open "insert into tabelpenghitungan values('" & tidcounter & "','" & tidkaryawan & "','" & tnamakaryawan & "','" & tjenisk & "','" & ttglmsk & "','" & tstatus & "','" & tdivisi & "','" & tdepartemen & "','" & tjabatan & "','" & ccuti & "','" & csakit & "','" & tgajipokok & "','" & tkehadiran & "','" & tjshift & "','" & ttjabatan & "','" & tanakistri & "','" & ttranspor & "','" & tpulsa & "','" & tjamot & "','" & tovertime & "','" & tpendapatan & "','" & tjpensiun & "','" & tserikat & "','" & cjim & "','" & tim & "','" & tpengurangan & "','" & tgajiditerima & "','" & tgl & "','" & kodedd & "','" & kodeuser & "')", KON
MsgBox "Data Sudah Tersimpan", vbInformation
cr.SelectionFormula = "Totext({tabelpenghitungan.idcounter})= '" & tidcounter.Text & "'"
cr.ReportFileName = "D:\Belajar MVB\slipgajikaryawan.rpt"
cr.WindowState = crptMaximized
cr.RetrieveDataFiles
cr.Action = 1
Call tampil
Call bersih
Call nonaktif
ctambah.Enabled = True
Call koneksi
rsdatakaryawan.Open "update tabelkaryawan set cuti='" & sisacuti & "' where kodedasar='" & kodedd & "'", KON
End If
20. Double klik pada cbatal dan pastekan koding dibawah (declaration=click) :
Call bersih
Call nonaktif
ctambah.Enabled = True
Call nonaktif
ctambah.Enabled = True
Sumber http://www.hendrisetiawan.com