Tinggalkan komentar

TUGAS 4

Kode program :
Private Sub CMDBATAL_Click()
TXTNAMA.SetFocus
TXTNAMA.Text = “”
TXTNIK.Text = “”
TXTGOL.Text = “”
TXTKS.Text = “”
TXTST.Text = “”
TXTTH.Text = “”
TXTJB.Text = “”
TXTBG.Text = “”
TXTGP.Text = “”
TXTTJ.Text = “”
TXTTG.Text = “”
End Sub

Private Sub CMDKELUAR_Click()
Unload Me
End Sub

Private Sub CMDLAGI_Click()
TXTNAMA.SetFocus
TXTNAMA.Text = “”
TXTNIK.Text = “”
TXTGOL.Text = “”
TXTKS.Text = “”
TXTST.Text = “”
TXTTH.Text = “”
TXTJB.Text = “”
TXTBG.Text = “”
TXTGP.Text = “”
TXTTJ.Text = “”
TXTTG.Text = “”
End Sub

Private Sub CMDPROSES_Click()
Dim NIK As String
NIK = Left(TXTNIK.Text, 3)
If NIK = “KEU” Then
TXTBG.Text = “ACCOUNTING”
ElseIf NIK = “ADM” Then
TXTBG.Text = “ADMINISTRASI”
ElseIf NIK = “SDM” Then
TXTBG.Text = “GENERAL AFFAIR”
ElseIf NIK = “EDP” Then
TXTBG.Text = “IT UNIT”
ElseIf NIK = “SPM” Then
TXTBG.Text = “SCURITY”
End If
NIK = Mid(TXTNIK.Text, 5, 4)
TXTTH.Text = NIK
NIK = Mid(TXTNIK.Text, 9, 1)
If NIK = “A” Then
TXTGOL.Text = “A”
TXTJB.Text = “MANAJER”
TXTGP.Text = “3000000”
TXTTJ.Text = “875000”
ElseIf NIK = “B” Then
TXTGOL.Text = “B”
TXTJB.Text = “K.A SEKSI”
TXTGP.Text = “2500000”
TXTTJ.Text = “525000”
ElseIf NIK = “C” Then
TXTGOL.Text = “C”
TXTJB.Text = “STAF”
TXTGP.Text = “2000000”
TXTTJ.Text = “325000”
End If
NIK = Right(TXTNIK.Text, 1)
If NIK = “S” Then
TXTKS.Text = “S”
TXTST.Text = “SINGLE”
ElseIf NIK = “M” Then
TXTKS.Text = “M”
TXTST.Text = “MENIKAH”
ElseIf NIK = “D” Then
TXTKS.Text = “D”
TXTST.Text = “DUDA”
ElseIf NIK = “J” Then
TXTKS.Text = “J”
TXTST.Text = “JANDA”
End If
TXTTG.Text = Val(TXTGP.Text) + Val(TXTTJ.Text)
End Sub

Private Sub TXTNAMA_KEYPRESS(KEYASCII As Integer)
If KEYASCII = 13 Then
TXTNIK.SetFocus
End If
End Sub

Kode program :
Private Sub CMDBATAL_Click()
TXTNAMA.SetFocus
TXTNAMA.Text = “”
TXTNIK.Text = “”
TXTGOL.Text = “”
TXTKS.Text = “”
TXTST.Text = “”
TXTTH.Text = “”
TXTJB.Text = “”
TXTBG.Text = “”
TXTGP.Text = “”
TXTTJ.Text = “”
TXTTG.Text = “”
End Sub

Private Sub CMDKELUAR_Click()
Unload Me
End Sub

Private Sub CMDLAGI_Click()
TXTNAMA.SetFocus
TXTNAMA.Text = “”
TXTNIK.Text = “”
TXTGOL.Text = “”
TXTKS.Text = “”
TXTST.Text = “”
TXTTH.Text = “”
TXTJB.Text = “”
TXTBG.Text = “”
TXTGP.Text = “”
TXTTJ.Text = “”
TXTTG.Text = “”
End Sub

Private Sub CMDPROSES_Click()
Dim NIK As String
NIK = Left(TXTNIK.Text, 3)
If NIK = “KEU” Then
TXTBG.Text = “ACCOUNTING”
ElseIf NIK = “ADM” Then
TXTBG.Text = “ADMINISTRASI”
ElseIf NIK = “SDM” Then
TXTBG.Text = “GENERAL AFFAIR”
ElseIf NIK = “EDP” Then
TXTBG.Text = “IT UNIT”
ElseIf NIK = “SPM” Then
TXTBG.Text = “SCURITY”
End If
NIK = Mid(TXTNIK.Text, 5, 4)
TXTTH.Text = NIK
NIK = Mid(TXTNIK.Text, 9, 1)
If NIK = “A” Then
TXTGOL.Text = “A”
TXTJB.Text = “MANAJER”
TXTGP.Text = “3000000”
TXTTJ.Text = “875000”
ElseIf NIK = “B” Then
TXTGOL.Text = “B”
TXTJB.Text = “K.A SEKSI”
TXTGP.Text = “2500000”
TXTTJ.Text = “525000”
ElseIf NIK = “C” Then
TXTGOL.Text = “C”
TXTJB.Text = “STAF”
TXTGP.Text = “2000000”
TXTTJ.Text = “325000”
End If
NIK = Right(TXTNIK.Text, 1)
If NIK = “S” Then
TXTKS.Text = “S”
TXTST.Text = “SINGLE”
ElseIf NIK = “M” Then
TXTKS.Text = “M”
TXTST.Text = “MENIKAH”
ElseIf NIK = “D” Then
TXTKS.Text = “D”
TXTST.Text = “DUDA”
ElseIf NIK = “J” Then
TXTKS.Text = “J”
TXTST.Text = “JANDA”
End If
TXTTG.Text = Val(TXTGP.Text) + Val(TXTTJ.Text)
End Sub

Private Sub TXTNAMA_KEYPRESS(KEYASCII As Integer)
If KEYASCII = 13 Then
TXTNIK.SetFocus
End If
End Sub

Private Sub Command1_Click()
Dim K, S As String
Dim C As Long
K = Left(Text2.Text, 1)
If K = “E” Or K = “e” Then
Text3.Text = “EKSEKUTIF”
S = Mid(Text2.Text, 6, 2)
If S = “01” Then
text5.Text = “STRATA SATU”
text8.Text = “200000”
text9.Text = “1900000”
text10.Text = “1250000”
text11.Text = “600000”
ElseIf S = “02” Then
text5.Text = “DIPLOMA TIGA”
text8.Text = “150000”
text9.Text = “1650000”
text10.Text = “1250000”
text11.Text = “600000”
ElseIf S = “03” Then
text5.Text = “DIPLOMA SATU”
text8.Text = “150000”
text9.Text = “1350000”
text10.Text = “1250000”
text11.Text = “600000”
End If
End If
C = Val(text8.Text) + Val(text9.Text) + Val(text10.Text) + Val(text11.Text)
text12.Text = C
If K = “R” Or K = “r” Then
Text3.Text = “REGULER”
S = Mid(Text2.Text, 6, 2)
If S = “01” Then
text5.Text = “STRATA SATU”
text8.Text = “200000”
text9.Text = “1500000”
text10.Text = “1000000”
text11.Text = “600000”
ElseIf S = “02” Then
text5.Text = “DIPLOMA TIGA”
text8.Text = “150000”
text9.Text = “1250000”
text10.Text = “1000000”
text11.Text = “600000”
ElseIf S = “03” Then
text5.Text = “DIPLOMA SATU”
text8.Text = “150000”
text9.Text = “1250000”
text10.Text = “1000000”
text11.Text = “600000”
End If
End If
C = Val(text8.Text) + Val(text9.Text) + Val(text10.Text) + Val(text11.Text)
text12.Text = C
text6.Text = “20” & Mid(Text2.Text, 3, 2)
S = Mid(Text2.Text, 5, 1)
If S = “1” Then
Text4.Text = “SISTEM INFORMASI”
ElseIf S = “2” Then
Text4.Text = “MANAJEMEN INFORMATIKA”
ElseIf S = “3” Then
Text4.Text = “MANAJEMEN & KOM.AKUTYANSI”
End If
text7.Text = Right(Text2.Text, 3)

text8.Text = FormatNumber(text8, 2)
text9.Text = FormatNumber(text9, 2)
text10.Text = FormatNumber(text10, 2)
text11.Text = FormatNumber(text11, 2)
text12.Text = FormatNumber(text12, 2)
End Sub

Private Sub Command2_Click()
Unload Me
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 = “”
text12.Text = “”
End Sub

Private Sub Command4_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 = “”
text12.Text = “”
End Sub

Private Sub Form_Activate()
Text1.SetFocus
Text1.Text = “”
Text2.Text = “”
Text3.Text = “”
Text4.Text = “”
text5.Text = “”
text6.Text = “”
text7.Text = “”
text8.Text = “”
text9.Text = “”
text10.Text = “”
text11.Text = “”
text12.Text = “”
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text2.SetFocus
End If
End Sub


List1.AddItem c
Loop
End Sub

KODE PROGRAM
Private Sub Form_Activate()
Dim A As Integer
A = 0
Do While A< 20
A = A + 2
List1.AddItem A
Loop
End Sub

KODE PROGRAM
Private Sub Form_Activate()
Dim B As Integer
For B = 5 To 499 Step 27
List1.AddItem B + 3
Next B
End Sub

Tinggalkan komentar