Selasa, 12 Desember 2017

Tugas 3.7 Pt.Pulang petang Setiap Hari oleh mahasiswa STMIK Pringsewu

Tugas 3.7 Pt.Pulang petang Setiap Hari


Berikut Source Codenya:

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
txtgolongan.Text = Mid(txtnik.Text, 5, 1)
txtkode.Text = Mid(txtnik.Text, 7, 1)
txttahun.Text = Left(txtnik.Text, 4)

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

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

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

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

End If

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

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

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

End If

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

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