Kali ini saya akan membagikan Cara Membuat Program Penggajian Menggunakan VB 6
Download Program Penggajian Visual Basic 6.0
1. Buka Aplikasi VB 6
2. Desain Form Seperti Ini
3. Ubah Property
Form1 - Caption - Program Penggajian Karyawan
Label1 - Caption - NIK :
Label2 - Caption - Nama :
Label3 - Caption - Jabatan :
Label4 - Caption - Gaji :
Label5 - Caption - Status :
Label6 - Caption - Tunjangan Istri :
Label7 - Caption - Pajak :
Label8 - Caption - Jam Lembur :
Label9 - Caption - Honor Lembur :
Label10 - Caption - Jumlah Anak :
Label11 - Caption - Tunjangan Anak :
Label 12 - Caption - Total Gaji :
Combo1 - Name - CmbNIK
Text1 - Name - TxNama
Combo2 - Name - CmbJabatan
Text2 - Name - TxGaji
Combo3 - Name - CmbStatus
Text3 - Name - TxTunjIstri
Text4 - Name - TxPajak
Combo4 - Name - CmbJLmbur
Text5 - Name - TxHonor
Combo5 - Name -CmbJAnak
Text6 - Name - TxTunjAnak
Text7 - Name - TxTotal
Command1 - Name - CmdBaru
- Caption - &Baru
Command2 - Name - CmdProses
- Caption - &Proses
Command3 - Name - CmdKeluar
- Caption - &Keluar aaaaaLaaabelbel7 - Caption - Pajak :
Lbel1 - jCaption - NIK :
Label1 - Caption - NIK :
Label1 - Caption - NIK :
Label1 - Caption - NIK :
Label1 - Caption - NIK :
4. Copy code berikut lalu klik View Code dan pastekan
Dim lembur As Double
Private Sub CmbJabatan_Click()
Select Case CmbJabatan.Text
Case "Mandor":
TxGaji.Text = 1750000
lembur = 7500
Case "Kepala Bagian":
TxGaji.Text = 2500000
lembur = 10000
Case "Staf":
TxGaji.Text = 1250000
lembur = 5000
End Select
TxPajak.Text = 0.015 * TxGaji.Text
End Sub
Private Sub CmbJAnak_Click()
On Error Resume Next
If CmbJAnak.Text >= 2 Then
TxTunjAnak.Text = 0.07 * TxGaji.Text
ElseIf CmbJAnak.Text = 1 Then
TxTunjAnak.Text = 0.03 * TxGaji.Text
Else
TxTunjAnak.Text = 0
End If
End Sub
Private Sub CmbJLembur_Click()
TxHonor.Text = CmbJLembur.Text * lembur
End Sub
Private Sub CmbNIK_Click()
Select Case CmbNIK.Text
Case "001": TxNama.Text = "Ali"
Case "002": TxNama.Text = "Udin"
Case "003": TxNama.Text = "Andi"
End Select
End Sub
Private Sub CmbStatus_Click()
Select Case CmbStatus.Text
Case "Menikah":
TxTunjIstri.Text = 0.09 * TxGaji.Text
CmbJAnak.Enabled = True
Case "Tidak Menikah":
CmbJAnak.Text = 0
CmbJAnak.Enabled = False
TxTunjIstri.Text = 0
TxTunjAnak.Text = 0
End Select
End Sub
Private Sub CmdBaru_Click()
CmbNIK.Text = ""
TxNama.Text = ""
CmbStatus.Text = ""
CmbJabatan.Text = ""
TxPajak.Text = ""
TxTotal.Text = ""
TxGaji.Text = ""
TxTunjIstri.Text = ""
TxTunjAnak.Text = ""
CmbJAnak.Text = ""
TxHonor.Text = ""
CmbJLembur.Text = ""
TxTunjAnak.Text = ""
End Sub
Private Sub CmdKeluar_Click()
Unload Me
End Sub
Private Sub CmdProses_Click()
TxTotal.Text = Val(TxGaji.Text) + Val(TxTunjIstri.Text) + Val(TxTunjAnak.Text) + Val(TxHonor.Text) - Val(TxPajak.Text)
End Sub
Private Sub Form_Load()
CmbNIK.AddItem "001"
CmbNIK.AddItem "002"
CmbNIK.AddItem "003"
CmbJabatan.AddItem "Mandor"
CmbJabatan.AddItem "Kepala Bagian"
CmbJabatan.AddItem "Staf"
CmbStatus.AddItem "Menikah"
CmbStatus.AddItem "Tidak Menikah"
For i = 1 To 5
CmbJAnak.AddItem i
Next i
For i = 1 To 5
CmbJLembur.AddItem i
Next i
Call CmdBaru_Click
End Sub
6. Jalankan Program dengan menekan F5, maka tampilannya akan seperti ini
Download Program Penggajian Visual Basic 6.0
SELAMAT MENCOBA...!!!
No comments:
Post a Comment