Rabu, 13 Desember 2017

Tugas 3.8

Private Sub Command1_Click()
Dim a As String
a = Mid(Text2, 1, 4)
If a = "2009" Then
Text6 = "2009"
End If
a = Mid(Text2, 5, 1)
If a = "A" Then
Text7 = "Manajer"
Text3 = "A"
Text9 = "4000000"
Text10 = "1025000"
ElseIf a = "B" Then
Text7 = "Ka. Seksi"
Text3 = "B"
Text9 = "3500000"
Text10 = "975000"
ElseIf a = "C" Then
Text7 = "Staff"
Text3 = "C"
Text9 = "3000000"
Text10 = "925000"
End If
a = Mid(Text2, 7, 1)
If a = "S" Then
Text4 = "S"
Text5 = "Single"
ElseIf a = "M" Then
Text4 = "M"
Text5 = "Menikah"
ElseIf a = "J" Then
Text4 = "J"
Text5 = "Janda"
ElseIf a = "D" Then
Text4 = "D"
Text5 = "Duda"
End If
a = Mid(Text2, 9, 3)
If a = "KEU" Then
Text8 = "Accounting"
ElseIf a = "ADM" Then
Text8 = "Administrasi"
ElseIf a = "SDM" Then
Text8 = "General Affair"
ElseIf a = "EDP" Then
Text8 = "IT Unit"
ElseIf a = "SPM" Then
Text8 = "Security"
End If
Text11 = Val(Text9) + Val(Text10)
End Sub

Private Sub Command2_Click()
Text1 = ""
Text2 = ""
Text3 = ""
Text4 = ""
Text5 = ""
Text6 = ""
Text7 = ""
Text8 = ""
Text9 = ""
Text10 = ""
Text11 = ""
End Sub

Private Sub Command4_Click()
Unload Me
End Sub

Private Sub Command3_Click()
Text1 = ""
Text2 = ""
Text3 = ""
Text4 = ""
Text5 = ""
Text6 = ""
Text7 = ""
Text8 = ""
Text9 = ""
Text10 = ""
Text11 = ""
End Sub


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


Tugas 3.7


Private Sub Command4_Click()
Unload Me
End Sub

Private Sub Command1_Click()
Dim A As String
A = Mid(Text1, 1, 3)
If A = "SIM" Then
Text2 = "Sistem Informasi Manajemen"
Text3 = "Fadiya Ulfa"
Text6 = "75900"
ElseIf A = "EDP" Then
Text2 = "Elektronik Data Proseccing"
Text3 = "Nurul Agustina"
Text6 = "62000"
ElseIf A = "MNJ" Then
Text2 = "MANAJEMEN"
Text3 = "Rian Hidayat"
Text6 = "42000"
ElseIf A = "CDR" Then
Text2 = "Corel Draw"
Text3 = "Siti Nur Khotima"
Text6 = "53000"
ElseIf A = "RPL" Then
Text2 = "Rekayasa Perangkat Lunak"
Text3 = "Winda Erlianti"
Text6 = "83000"
End If
A = Mid(Text1, 5, 2)
If A = "09" Then
Text4 = "2009"
ElseIf A = "10" Then
Text4 = "2010"
ElseIf A = "11" Then
Text4 = "2011"
ElseIf A = "12" Then
Text4 = "2012"
ElseIf A = "13" Then
Text4 = "2013"
End If
A = Mid(Text1, 8, 1)
If A = "A" Then
Text5 = "Andi Offset Yogyakarta"
ElseIf A = "I" Then
Text5 = "Indah Surabaya"
ElseIf A = "S" Then
Text5 = "Salemba Empat"
ElseIf A = "E" Then
Text5 = "Elek Media Komputindo"
ElseIf A = "M" Then
Text5 = "Maxicom"
End If
End Sub

Private Sub Command2_Click()
Text1 = ""
Text2 = ""
Text3 = ""
Text4 = ""
Text5 = ""
Text6 = ""
End Sub

Private Sub Command3_Click()
Text1 = ""
Text2 = ""
Text3 = ""
Text4 = ""
Text5 = ""
Text6 = ""
End Sub


Tugas 3.6

Private Sub Cmdkeluar_Click()
Unload Me
End Sub

Private Sub Cmdlagi_Click()
Txtkt = ""
Txtjk = ""
Txtht = ""
Txtjb = ""
Txtjt = ""
txttotalp = ""
End Sub

Private Sub Cmdproses_Click()
Dim a As String
a = Mid(Txtkt, 1, 3)
If a = "BIM" Then
Txtjk = "BIMA"
Txtht = "50000"
Txtjb = "16.00"
End If
If a = "EKO" Then
Txtjk = "EKONOMI"
Txtht = "35000"
Txtjb = "19.00"
End If
If a = "MUT" Then
Txtjk = "MUTIARA"
Txtht = "23000"
Txtjb = "17.00"
End If
If a = "SEN" Then
Txtjk = "SENJA"
Txtht = "15000"
Txtjb = "20.00"
End If
Txtjt.SetFocus
End Sub

Private Sub Txtjt_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txttotalp = Val(Txtjt) * Val(Txtht)
End If
End Sub

Tugas 3.5

Private Sub Command1_Click()
Dim A As String
A = Mid(Combo1, 1, 1)
If A = "A" Then
Text4 = "Abdi Offsyet Yogyakarta"
End If
A = Mid(Combo1, 3, 3)
If A = "SIM" Then
Text1 = "Sistem Informasi Manajemen"
Text2 = "Yati Nur Oktavia"
Text5 = "75900"
End If
A = Mid(Combo1, 7, 2)
If A = "01" Then
Text3 = "2001"
End If
A = Mid(Combo1, 1, 1)
If A = "I" Then
Text4 = "Indah Surabaya"
End If
A = Mid(Combo1, 3, 3)
If A = "EDP" Then
Text1 = "Electronik Data Processing"
Text2 = "Imam Tarmizi"
Text5 = "62000"
End If
A = Mid(Combo1, 7, 2)
If A = "02" Then
Text3 = "2002"
End If
A = Mid(Combo1, 1, 1)
If A = "S" Then
Text4 = "Irvan Bahari"
End If
A = Mid(Combo1, 3, 3)
If A = "MNJ" Then
Text1 = "MANAJEMEN"
Text2 = "Irvan Bahari"
Text5 = "79000"
End If
A = Mid(Combo1, 7, 2)
If A = "03" Then
Text3 = "2003"
End If
End Sub

Private Sub Command2_Click()
Combo1 = ""
Text1 = ""
Text2 = ""
Text3 = ""
Text4 = ""
Text5 = ""
End Sub

Private Sub Command3_Click()
Combo1 = ""
Text1 = ""
Text2 = ""
Text3 = ""
Text4 = ""
Text5 = ""
Combo1.SetFocus
End Sub

Private Sub Command4_Click()
Unload Me
End Sub

Private Sub Form_Load()
Combo1.AddItem "A-SIM-01"
Combo1.AddItem "I-EDP-02"
Combo1.AddItem "S-MNJ-03"
End Sub

Tugas 3.4

Private Sub CboKode_Click()
Dim s As String
s = Mid(CboKode, 7, 5)
 If s = "MC965" Then
 txtmerk = "Apple MacBook Pro MC965"
 Txths = "12800000"
 End If
 If s = "MC966" Then
 txtmerk = "Apple MacBook Pro MC966"
 Txths = "15800000"
 End If
 If s = "MC968" Then
 txtmerk = "Apple MacBook Pro MC968"
 Txths = "9900000"
 End If
 If s = "MC969" Then
 txtmerk = "Apple MacBook Pro MC969"
 Txths = "11900000"
 End If
 txtjj.SetFocus 
End Sub

Private Sub Command1_Click()
txthp = Val(txtjj) * Val(Txths)
If txthp > 40000000 Then
txtdis = (0.15) * Val(txthp)
ElseIf txthp > 35000000 Then
txtdis = (0.1) * Val(txthp)
ElseIf txthp > 30000000 Then
txtdis = (0.05) * Val(txthp)
ElseIf txthp > 25000000 Then
txtdis = (0.01) * Val(txthp)
End If
Txttb = Val(txthp) - Val(txtdis)
 End Sub

Private Sub Command2_Click()
CboKode = ""
txtmerk = ""
Txths = ""
Txtdis = ""
Txthp = ""
Txtjj = ""
Txttb = "" 
End Sub

Private Sub Form_load()
CboKode.AddItem "Apple MC965 MacBook Pro"
CboKode.AddItem "Apple MC966 MacBook Pro"
CboKode.AddItem "Apple MC968 MacBook Pro"
CboKode.AddItem "Apple MC969 MacBook Pro"
End Sub

Private Sub Command3_Click()
Unload Me
End Sub