Selasa, 12 Desember 2017

Tugas 3.7


Private Sub cmdbatal_Click()
txtnama.SetFocus
txtnik.Text = ""
txtgolongan.Text = ""
txtkode.Text = ""
txtstatus.Text = ""
txttahun.Text = ""
txtjabatan.Text = ""
txtbagian.Text = ""
txtgaji.Text = ""
txttunjangan.Text = ""
txttotal.Text = ""
txtnama.Text = ""
End Sub

Private Sub cmdlagi_Click()
txtnama.SetFocus
txtnik.Text = ""
txtgolongan.Text = ""
txtkode.Text = ""
txtstatus.Text = ""
txttahun.Text = ""
txtjabatan.Text = ""
txtbagian.Text = ""
txtgaji.Text = ""
txttunjangan.Text = ""
txttotal.Text = ""
txtnama.Text = ""
End Sub

Private Sub cmdkeluar_Click()
End
End Sub

Private Sub cmdproses_Click()
Dim x As String

x = Right(txtnik.Text, 3)
If x = "KEU" Then
txtbagian.Text = "Accounting"

ElseIf x = "ADM" Then
txtbagian.Text = "Administrasi"

ElseIf x = "SDM" Then
txtbagian.Text = "General Affair"

ElseIf x = "EDP" Then
txtbagian.Text = "IT Unit"

ElseIf x = "SPM" Then
txtbagian.Text = "Security"
End If

x = Mid(txtnik.Text, 7, 1)
If x = "S" Or x = "s" Then
txtkode.Text = "S"
txtstatus.Text = "Single"

ElseIf x = "M" Or x = "m" Then
txtkode.Text = "M"
txtstatus.Text = "Menikah"

ElseIf x = "J" Or x = "j" Then
txtkode.Text = "J"
txtstatus.Text = "Janda"

ElseIf x = "D" Or x = "d" Then
txtkode.Text = "D"
txtstatus.Text = "Duda"

End If

x = Mid(txtnik.Text, 5, 1)
If x = "A" Or x = "a" Then
txtgolongan.Text = "A"
txtjabatan.Text = "Manager"
txtgaji.Text = "4000000"
txttunjangan.Text = "1025000"

ElseIf x = "B" Or x = "b" Then
txtgolongan.Text = "B"
txtjabatan.Text = "Ka.Seksi"
txtgaji.Text = "3500000"
txttunjangan.Text = "975000"

ElseIf x = "C" Or x = "c" Then
txtgolongan.Text = "C"
txtjabatan.Text = "Staff"
txtgaji.Text = "3000000"
txttunjangan.Text = "925000"

End If
txttahun = Left(txtnik.Text, 4)

txttotal.Text = Val(txtgaji.Text) + Val(txttunjangan.Text)
End Sub

Private Sub txtnama_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtnik.SetFocus
End If
End Sub

0 komentar:

Posting Komentar