TUGAS3-1
Private Sub cbogolongan_Click()
Dim gaji, tunjangan, pajak, total As Variant
Select Case cbogolongan
Case "I"
gaji = 1500000
tunjangan = 150000
Case "II"
gaji = 2000000
tunjangan = 200000
Case "III"
gaji = 2500000
tunjangan = 250000
Case "IV"
gaji = 3000000
tunjangan = 300000
gaji = 0
tunjangan = 0
End Select
total = gaji + tunjangan
pajak = total * 0.1
txtgaji = gaji
txtpajak = pajak
txttunjangan = tunjangan
txttotal = total - pajak
End Sub
Private Sub cmdbatal_Click()
txtnpm = ""
txtnama = ""
cbogolongan = ""
txtgaji = ""
txttunjangan = ""
txtpajak = ""
txttotal = ""
txtnpm.SetFocus
End Sub
Private Sub cmdkeluar_Click()
End
End Sub
Private Sub cmdlagi_Click()
txtnpm = ""
txtnama = ""
cbogolongan = ""
txtgaji = ""
txttunjangan = ""
txtpajak = ""
txttotal = ""
txtnpm.SetFocus
End Sub
Private Sub Form_Load()
cbogolongan.AddItem "I"
cbogolongan.AddItem "II"
cbogolongan.AddItem "III"
cbogolongan.AddItem "IV"
End Sub
Private Sub txtnpm_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtnama.SetFocus
End If
End Sub
Komentar
Posting Komentar