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

tugas 3 dari 4

tugas 3 dari 4

Private Sub Command1_Click()
Dim S As String
Text5.Text = “20” & Left(Text2.Text, 2)
S = Mid(Text2.Text, 3, 1)
If S = “1” Then
Text3.Text = “Sistem Informasi”
ElseIf S = “2” Then
Text3.Text = “Manajemen Informatika”
ElseIf S = “3” Then
Text3.Text = “Tehnik Informatika”
ElseIf S = “4” Then
Text3.Text = “Manajemen & Komp. Akuntansi”
End If
S = Mid(Text2.Text, 4, 2)
If S = “01” Then
Text4.Text = “Strata Satu”
ElseIf S = “02” Then
Text4.Text = “Diploma Tiga”
ElseIf S = “03” Then
Text4.Text = “Diploma Empat”
ElseIf S = “04” Then
Text4.Text = “Diploma Dua”
End If
Text6.Text = Right(Text2.Text, 3)
End Sub
Private Sub Text1_KEYPRESS(KEYASCII As Integer)
If KEYASCII = 13 Then
Text2.SetFocus
End If
End Sub

Private Sub Command2_Click()
Text1.SetFocus
Text1.Text = “”
Text2.Text = “”
Text3.Text = “”
Text4.Text = “”
Text5.Text = “”
Text6.Text = “”
End Sub

Private Sub Command3_Click()
Text1.SetFocus
Text1.Text = “”
Text2.Text = “”
Text3.Text = “”
Text4.Text = “”
Text5.Text = “”
Text6.Text = “”
End Sub

Private Sub Command4_Click()
End
End Sub

tugas 2 dari 4

tugas 2 dari 4

Private Sub Command1_Click()
Dim S As String
Text5.Text = “20” & Left(Text2.Text, 2)
S = Mid(Text2.Text, 3, 1)
If S = “1” Then
Text3.Text = “Sistem Informasi”
ElseIf S = “2” Then
Text3.Text = “Manajemen Informatika”
ElseIf S = “3” Then
Text3.Text = “Tehnik Informatika”
ElseIf S = “4” Then
Text3.Text = “Manajemen & Komp. Akuntansi”
End If
S = Mid(Text2.Text, 4, 2)
If S = “01” Then
Text4.Text = “Strata Satu”
ElseIf S = “02” Then
Text4.Text = “Diploma Tiga”
ElseIf S = “03” Then
Text4.Text = “Diploma Empat”
ElseIf S = “04” Then
Text4.Text = “Diploma Dua”
End If
Text6.Text = Right(Text2.Text, 3)
End Sub
Private Sub Text1_KEYPRESS(KEYASCII As Integer)
If KEYASCII = 13 Then
Text2.SetFocus
End If
End Sub

Private Sub Command2_Click()
Text1.SetFocus
Text1.Text = “”
Text2.Text = “”
Text3.Text = “”
Text4.Text = “”
Text5.Text = “”
Text6.Text = “”
End Sub

Private Sub Command3_Click()
Text1.SetFocus
Text1.Text = “”
Text2.Text = “”
Text3.Text = “”
Text4.Text = “”
Text5.Text = “”
Text6.Text = “”
End Sub

Private Sub Command4_Click()
End
End Sub

tugas vb 1 dari 4

tugas vb 1 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

Tugas 10

Tugas 10

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

Private Sub Text3_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text4.Text = Val(Text1.Text) + Val(Text2.Text) – Val(Text3.Text)
Text5.Text = Val(Text4.Text) * 0.2
Text6.Text = Val(Text4.Text) – Val(Text5.Text)
End If
End Sub

Private Sub Command1_Click()
Text4.Text = Val(Text1.Text) + Val(Text2.Text) – Val(Text3.Text)
Text5.Text = Val(Text4.Text) * 0.2
Text6.Text = Val(Text4.Text) – Val(Text5.Text)
End Sub

Private Sub Command2_Click()
Text1.Text = “”
Text2.Text = “”
Text3.Text = “”
Text4.Text = “”
Text5.Text = “”
Text6.Text = “”
Text1.SetFocus
End Sub

Private Sub Command3_Click()
End
End Sub

Tugas 9

Tugas 9

Private Sub Command1_Click()
Label2.Caption = Text1.Text
End Sub

Private Sub Command2_Click()
End
End Sub

Private Sub Option1_Click()
Label2.ForeColor = vbBlue
End Sub

Private Sub Option2_Click()
Label2.ForeColor = vbRed
End Sub

Private Sub Check1_Click()
Label2.FontBold = Check1.Value
End Sub

Private Sub Check2_Click()
Label2.FontItalic = Check2.Value
End Sub

Tugas 8

Tugas 8

Source Code :

Private Sub Combo1_Click()
Select Case Combo1
Case “Lifeboy”
harga = “2700″
Case “Rinso”
harga = “1000″
Case “Molto”
harga = “7000″
End Select
Text1.Text = harga
Text2.SetFocus
End Sub

Private Sub Form_Load()
Combo1.AddItem “Lifeboy”
Combo1.AddItem “Rinso”
Combo1.AddItem “Molto”
End Sub

Private Sub Text3_Change()
Text3.Text = Val(Text1.Text) * Val(Text2.Text)
End Sub
Private Sub command1_click()
Text3.Text = Val(Text1.Text) * Val(Text2.Text)
End Sub

Private Sub text1_keypress(keyascii As Integer)
If keyascii = 13 Then
Text2.SetFocus
End If
End Sub
Private Sub text2_keypress(keyascii As Integer)
If keyascii = 13 Then
Text3.Text = Val(Text1.Text) * Val(Text2.Text)
End If
End Sub
Private Sub command2_click()
Text1.SetFocus
Text1 = “”
Text2 = “”
Text3 = “”
End Sub
Private Sub command3_click()
End
End Sub

Tugas 7

Tugas 7

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

Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text3.Text = Val(Text1.Text) * Val(Text2.Text)
End If
End Sub

Tugas 6

Tugas 6

Private Sub Command1_Click()
Dim S As String
Text5.Text = “20″ & Left(Text2.Text, 2)
S = Mid(Text2.Text, 3, 1)
If S = “1″ Then
Text3.Text = “Sistem Informasi”
ElseIf S = “2″ Then
Text3.Text = “Manajemen Informatika”
ElseIf S = “3″ Then
Text3.Text = “Tehnik Informatika”
ElseIf S = “4″ Then
Text3.Text = “Manajemen & Komp. Akuntansi”
End If
S = Mid(Text2.Text, 4, 2)
If S = “01″ Then
Text4.Text = “Strata Satu”
ElseIf S = “02″ Then
Text4.Text = “Diploma Tiga”
ElseIf S = “03″ Then
Text4.Text = “Diploma Empat”
ElseIf S = “04″ Then
Text4.Text = “Diploma Dua”
End If
Text6.Text = Right(Text2.Text, 3)
End Sub

Private Sub Text1_KEYPRESS(KEYASCII As Integer)
If KEYASCII = 13 Then
Text2.SetFocus
End If
End Sub

Private Sub Command2_Click()
Text1.SetFocus
Text1.Text = “”
Text2.Text = “”
Text3.Text = “”
Text4.Text = “”
Text5.Text = “”
Text6.Text = “”
End Sub

Private Sub Command3_Click()
Text1.SetFocus
Text1.Text = “”
Text2.Text = “”
Text3.Text = “”
Text4.Text = “”
Text5.Text = “”
Text6.Text = “”
End Sub

Private Sub Command4_Click()
End
End Sub

Tugas 5

Tugas 5

Private Sub Command1_Click()
Text3.Text = Val(Text1.Text) / Val(Text2.Text)
End Sub

Private Sub Command2_Click()
Text1.SetFocus
Text1 = “”
Text2 = “”
Text3 = “”
End Sub

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

Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text3.Text = Val(Text1.Text) / Val(Text2.Text)
End If
End Sub

Private Sub Command3_Click()
End
End Sub