tugas 4 dari 4

tugas 4 dari 4

Private Sub Command1_Click()
Dim S As String
S = Mid(Text11.Text, 1, 4)
Text4.Text = S

S = Mid(Text11.Text, 5, 1)
If S = “A” Then
Text1.Text = “A”
Text5.Text = “Manajer”
Text7.Text = “4000000”
Text8.Text = “1025000”
Text9.Text = (Val(Text7.Text) + Val(Text8.Text))
ElseIf S = “B” Then
Text1.Text = “B”
Text5.Text = “Ka. Seksi”
Text7.Text = “3500000”
Text8.Text = “975000”
Text9.Text = (Val(Text7.Text) + Val(Text8.Text))
ElseIf S = “C” Then
Text1.Text = “C”
Text5.Text = “Staff”
Text7.Text = “3000000”
Text8.Text = “925000”
Text9.Text = (Val(Text7.Text) + Val(Text8.Text))
End If

S = Mid(Text11.Text, 7, 1)
If S = “S” Then
Text1.Text = “S”
Text3.Text = “Single”
ElseIf S = “M” Then
Text2.Text = “M”
Text3.Text = “Menikah”
ElseIf S = “J” Then
Text2.Text = “J”
Text3.Text = “Janda”
ElseIf S = “D” Then
Text2.Text = “D”
Text3.Text = “Duda”
End If
S = Right(Text11.Text, 3)
If S = “KEU” Then
Text6.Text = “Accounting”
ElseIf S = “ADM” Then
Text6.Text = “Administrasi”
ElseIf S = “SDM” Then
Text6.Text = “General Affair”
ElseIf S = “EDP” Then
Text6.Text = “IT Unit”
ElseIf S = “SPM” Then
Text6.Text = “Security”
End If
End Sub

Private Sub Command2_Click()
Text1.SetFocus
Text1.Text = “”
Text2.Text = “”
Text3.Text = “”
Text4.Text = “”
Text5.Text = “”
Text6.Text = “”
Text7.Text = “”
Text8.Text = “”
Text9.Text = “”
Text10.Text = “”
Text11.Text = “”
End Sub

Private Sub Command3_Click()
Text1.SetFocus
Text1.Text = “”
Text2.Text = “”
Text3.Text = “”
Text4.Text = “”
Text5.Text = “”
Text6.Text = “”
Text7.Text = “”
Text8.Text = “”
Text9.Text = “”
Text10.Text = “”
Text11.Text = “”
End Sub

Private Sub Command4_Click()
Unload Me
End Sub

Private Sub Text10_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text11.SetFocus
End If
End Sub

Leave a comment