Private Sub cmdkeluar_Click()
x = MsgBox("anda ingin menutup form ini?", vbQuestion + vbYesNo, "konfirmasi")
If x = vbYes Then
Unload Me
End If
End Sub
Private Sub Form_Activate()
txtnip.SetFocus
txttgl.Text = Date
cmbgol.AddItem "I"
cmbgol.AddItem "II"
cmbgol.AddItem "III"
cmbgol.AddItem "IV"
cmbgol.AddItem "V"
cmdhitung.Enabled = True
cmdkeluar.Enabled = True
End Sub
Sub bersih()
txtnip.Text = ""
txtnama.Text = ""
cmbgol.Text = ""
txtjab.Text = ""
txtgapok.Text = ""
opt1.Value = 0
opt2.Value = 0
opt3.Value = 0
txttunjangan.Text = ""
txttrans.Text = ""
txtstatus.Text = ""
txtkotor.Text = ""
txtpph.Text = ""
txtbersih.Text = ""
End Sub
Private Sub cmbgol_Click()
If cmbgol.Text = "I" Then
txtjab.Text = "Paintry"
txtgapok.Text = 1000000
txttunjangan = 200000
txttransport = 0
ElseIf cmbgol.Text = "II" Then
txtjab.Text = "Staff"
txtgapok.Text = 1750000
txttunjangan = 300000
txttransport = 200000
ElseIf cmbgol.Text = "III" Then
txtjab.Text = "Supervisor"
txtgapok.Text = 2250000
txttunjangan = 500000
txttransport = 300000
ElseIf cmbgol.Text = "IV" Then
txtjab.Text = "Manajer"
txtgapok.Text = 5000000
txttunjangan = 700000
txttransport = 500000
Else
txtjab.Text = "Direktur"
txtgapok.Text = 10000000
txttunjangan = 1000000
txttrans = 1000000
End If
End Sub
Private Sub cmdhitung_Click()
bersih
txtnip.SetFocus
cmbgol.Text = ""
cmdhitung.Enabled = False
cmdkeluar.Enabled = True
End Sub
Private Sub opt1_Click()
If opt1.Value = True Then
txtstatus.Text = 300000
txtkotor.Text = Val(txtgapok.Text) + Val(txttunjangan.Text) + Val(txtstatus.Text)
txtpph.Text = 0.1 * Val(txtkotor.Text)
txtbersih.Text = Val(txtkotor.Text) - Val(txtpph.Text)
End If
End Sub
Private Sub opt2_Click()
If opt2.Value = True Then
txtstatus.Text = 0
txtkotor.Text = Val(txtgapok.Text) + Val(txttunjangan.Text) + Val(txtstatus.Text)
txtpph.Text = 0.1 * Val(txtkotor.Text)
txtbersih.Text = Val(txtkotor.Text) - Val(txtpph.Text)
End If
End Sub
Private Sub opt3_Click()
If opt3.Value = True Then
txtstatus.Text = 100000
txtkotor.Text = Val(txtgapok.Text) + Val(txttunjangan.Text) + Val(txtstatus.Text)
txtpph.Text = 0.1 * Val(txtkotor.Text)
txtbersih.Text = Val(txtkotor.Text) - Val(txtpph.Text)
End If
End Sub
0 komentar:
Posting Komentar