Rabu, 11 April 2012

Tampilan dan Listing Tugas PRA UTS 1

Tampilan Tugas Pra UTS 1, Sebagai Berikut :



Listing Tugas Pra UTS 2, Sebagai Berikut:

Sub aktif()                                              
txtnip.Enabled = False
txtnama.Enabled = False
cmbgol.Enabled = False
txttgl.Enabled = False
txtjabatan.Enabled = False
txtgapok.Enabled = False
txttunjangan.Enabled = False
txttransport.Enabled = False
opt1.Enabled = False
opt2.Enabled = False
opt3.Enabled = False
txtstatus.Enabled = False
txtgator.Enabled = False
txtpph.Enabled = False
txtgaber.Enabled = False
End Sub

Sub nonaktif()
txtnip.Enabled = True
txtnama.Enabled = True
cmbgol.Enabled = True
opt1.Enabled = True
opt2.Enabled = True
opt3.Enabled = True
End Sub

Sub nonaktif()
txtnip.Enabled = False
txtnama.Enabled = False
cmbgol.Enabled = False
txttgl.Enabled = False
txtjabatan.Enabled = False
txtgapok.Enabled = False
txttunjangan.Enabled = False
txttransport.Enabled = False
opt1.Enabled = False
opt2.Enabled = False
opt3.Enabled = False
txtstatus.Enabled = False
txtgator.Enabled = False
txtpph.Enabled = False
txtgaber.Enabled = False
End Sub

Sub bersih()
txtnip.Text = ""
txtnama.Text = ""
cmbgol.Text = ""
txtjabatan.Text = ""
txtgapok.Text = ""
txttunjangan.Text = ""
txttransport.Text = ""
opt1.Value = 0
opt2.Value = 0
opt3.Value = 0
txtstatus.Text = ""
txtgator.Text = ""
txtpph.Text = ""
txtgaber.Text = ""
End Sub

Private Sub cmbgol_Click()
If cmbgol.Text = "I" Then
txtjabatan.Text = "Paintry"
txtgapok.Text = 1000000
txttunjangan.Text = 2000000
txttransport.Text = 0
ElseIf cmbgol.Text = "II" Then
txtjabatan.Text = "Staff"
txtgapok.Text = 1750000
txttunjangan.Text = 3000000
txttransport.Text = 200000
ElseIf cmbgol.Text = "III" Then
txtjabatan.Text = "Supervisor"
txtgapok.Text = 2250000
txttunjangan.Text = 5000000
txttransport.Text = 300000
ElseIf cmbgol.Text = "IV" Then
txtjabatan.Text = "Manager"
txtgapok.Text = 5000000
txttunjangan.Text = 7000000
txttransport.Text = 500000
Else
txtjabatan.Text = "Direktur"
txtgapok.Text = 100000000
txttunjangan.Text = 10000000
txttransport.Text = 1000000
End If
End Sub

Private Sub cmdhitunglagi_Click()
bersih
aktif
txtnip.SetFocus
cmbgol.Text = "-Pilih-"
End Sub

Private Sub cmdkeluar_Click()
X = MsgBox("Yakin Keluar", vbYesNo + vbQuestion, "Konfirmasi")
If X = vbYes Then
Unload Me
End If
End Sub

Private Sub Form_Activate()
bersih
nonaktif
txttgl.Text = Date
cmbgol.AddItem "I"
cmbgol.AddItem "II"
cmbgol.AddItem "III"
cmbgol.AddItem "IV"
cmbgol.AddItem "V"
cmdhitunglagi.Enabled = True
cmdkeluar.Enabled = True
End Sub

Private Sub opt1_Click()
If opt1.Value = True Then
txtstatus.Text = 300000
txtgator.Text = Val(txtgapok.Text) + Val(txttunjangan.Text) + Val(txttransport.Text) + Val(txtstatus.Text)
txtpph.Text = 0.1 * Val(txtgator.Text)
txtgaber.Text = Val(txtgator.Text) - Val(txtpph.Text)
End If
End Sub

Private Sub opt2_Click()
If opt2.Value = True Then
txtstatus.Text = 0
txtgator.Text = Val(txtgapok.Text) + Val(txttunjangan.Text) + Val(txttransport.Text) + Val(txtstatus.Text)
txtpph.Text = 0.1 * Val(txtgator.Text)
txtgaber.Text = Val(txtgator.Text) - Val(txtpph.Text)
End If
End Sub

Private Sub opt3_Click()
If opt3.Value = True Then
txtstatus.Text = 1000000
txtgator.Text = Val(txtgapok.Text) + Val(txttunjangan.Text) + Val(txttransport.Text) + Val(txtstatus.Text)
txtpph.Text = 0.1 * Val(txtgator.Text)
txtgaber.Text = Val(txtgator.Text) - Val(txtpph.Text)
End If
End Sub

Tidak ada komentar:

Posting Komentar