Selasa, 12 Desember 2017

Tugas 3.7


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

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

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

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

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

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

End If

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

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

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

End If
txttahun = Left(txtnik.Text, 4)

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

Tugas 3.6


Private Sub cmdbatal_Click()
cbokode = ""
txtjudul = ""
txtpengarang = ""
txttahun = ""
txtpenerbit = ""
txtharga = ""
cbokode.SetFocus
End Sub

Private Sub cmdkeluar_Click()
End
End Sub

Private Sub cmdlagi_Click()
cbokode = ""
txtjudul = ""
txtpengarang = ""
txttahun = ""
txtpenerbit = ""
txtharga = ""
cbokode.SetFocus
End Sub

Private Sub cmdproses_Click()
Dim A As String
A = Left(txtkode, 3)
If A = "SIM" Then
txtjudul = "Sistem Informasi Manajemen"
txtpengarang = "Fadiya Ulfa"
txtharga = "75900"
ElseIf A = "EDP" Then
txtjudul = "Elektronik Data Processing"
txtpengarang = "Nurul Agustina"
txtharga = "62000"
ElseIf A = "MNJ" Then
txtjudul = "Manajemen"
txtpengarang = "Rian Hidayat"
txtharga = "42000"
ElseIf A = "CDR" Then
txtjudul = "Corel Draw"
txtpengarang = "Siti Nur Khotimah"
txtharga = "53000"
ElseIf A = "RPL" Then
txtjudul = "Rekayasa Perangkat Lunak"
txtpengarang = "Winda Erlianti"
txtharga = "83000"
End If
txttahun = "20" & Mid(txtkode, 5, 2)
A = Right(txtkode, 1)
If A = "A" Then
txtpenerbit = "Andi Offset Yogyakarta"
ElseIf A = "I" Then
txtpenerbit = "Indah Surabaya"
ElseIf A = "S" Then
txtpenerbit = "Salemba Empat"
ElseIf A = "E" Then
txtpenerbit = "Elek Media Komputindo"
ElseIf A = "M" Then
txtpenerbit = "Maxicom"
End If
End Sub

Tugas 3.5


Private Sub cmdkeluar_Click()
End
End Sub

Private Sub cmdlagi_Click()
txtkt = ""
txtht = ""
txtjk = ""
txtjb = ""
txtjt = ""
txttotal = ""
txtkt.SetFocus
End Sub

Private Sub cmdproses_Click()
Dim B As String
B = Left(txtkt, 3)
If B = "BIM" Then
txtht = "50000"
txtjk = "BIMA"
txtjb = "16.00"
ElseIf B = "EKO" Then
txtht = "35000"
txtjk = "EKONOMI"
txtjb = "19.00"
ElseIf B = "MUT" Then
txtht = "23000"
txtjk = "MUTIARA"
txtjb = "17.00"
ElseIf B = "SEN" Then
txtht = "15000"
txtjk = "SENJA"
txtjb = "20.00"
End If
txtjt.SetFocus
End Sub

Private Sub txtjt_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txttotal = Val(txtht) * (txtjt)
End If
End Sub

Tugas 3.4


Private Sub cbokode_Click()
Select Case cbokode
Case "A-SIM-01"
Case "I-EDP-02"
Case "S-MNJ-03"
Case "E-CDR-04"
Case "M-RPL-05"
End Select
End Sub

Private Sub cmdbatal_Click()
cbokode = ""
txtjudul = ""
txtpengarang = ""
txttahun = ""
txtpenerbit = ""
txtharga = ""
cbokode.SetFocus
End Sub

Private Sub cmdkeluar_Click()
End
End Sub

Private Sub cmdlagi_Click()
cbokode = ""
txtjudul = ""
txtpengarang = ""
txttahun = ""
txtpenerbit = ""
txtharga = ""
cbokode.SetFocus
End Sub

Private Sub cmdproses_Click()
Dim A As String
A = Left(cbokode, 1)
If A = "A" Then
txtpenerbit = "Andi Offset Yogyakarta"
ElseIf A = "I" Then
txtpenerbit = "Indah Surabaya"
ElseIf A = "S" Then
txtpenerbit = "Salemba Empat"
ElseIf A = "E" Then
txtpenerbit = "Elek Media Komputindo"
ElseIf A = "M" Then
txtpenerbit = "Maxicom"
End If
A = Mid(cbokode, 3, 3)
If A = "SIM" Then
txtjudul = "Sistem Informasi Manajemen"
txtpengarang = "Yati Nur Oktavia"
txtharga = "75900"
ElseIf A = "EDP" Then
txtjudul = "Elektronik Data Processing"
txtpengarang = "Imam Tarmizi"
txtharga = "62000"
ElseIf A = "MNJ" Then
txtjudul = "Manajemen"
txtpengarang = "Valentina Mariana Adiwianti"
txtharga = "42000"
ElseIf A = "CDR" Then
txtjudul = "Corel Draw"
txtpengarang = "Riyan Suhandi"
txtharga = "53000"
ElseIf A = "RPL" Then
txtjudul = "Rekayasa Perangkat Lunak"
txtpengarang = "Sinta Umpu Singa"
txtharga = "83000"
End If
txttahun = "20" & Right(cbokode, 2)
End Sub

Private Sub Form_Load()
cbokode.AddItem "A-SIM-01"
cbokode.AddItem "I-EDP-02"
cbokode.AddItem "S-MNJ-03"
cbokode.AddItem "E-CDR-04"
cbokode.AddItem "M-RPL-05"
End Sub

Tugas 3.3


Private Sub cbokode_Click()
Dim merk As String
merk = Mid(cbokode, 7, 5)
If merk = "MC965" Then
txtmerk = "Apple MacBook Air MC965"
harga = "12800000"
ElseIf merk = "MC966" Then
txtmerk = "Apple MacBook Air MC966"
harga = "15800000"
ElseIf merk = "MC968" Then
txtmerk = "Apple MacBook Air MC968"
harga = "9900000"
ElseIf merk = "MC969" Then
txtmerk = "Apple MacBook Air MC969"
harga = "11900000"
ElseIf merk = "MC700" Then
txtmerk = "Apple MacBook Pro MC700"
harga = "10800000"
ElseIf merk = "MC721" Then
txtmerk = "Apple MacBook Pro MC721"
harga = "15900000"
ElseIf merk = "MC723" Then
txtmerk = "Apple MacBook Pro MC723"
harga = "19300000"
ElseIf merk = "MC724" Then
txtmerk = "Apple MacBook Pro MC724"
harga = "13700000"
ElseIf merk = "MC311" Then
txtmerk = "Apple MacBook Pro MC311"
harga = "24200000"
ElseIf merk = "MC313" Then
txtmerk = "Apple MacBook Pro MC313"
harga = "11900000"
ElseIf merk = "MC314" Then
txtmerk = "Apple MacBook Pro MC314"
harga = "14700000"
ElseIf merk = "MC318" Then
txtmerk = "Apple MacBook Pro MC318"
harga = "17600000"
ElseIf merk = "MC322" Then
txtmerk = "Apple MacBook Pro MC322"
harga = "21300000"
ElseIf merk = "MC965" Then
txtmerk = "Apple MacBook Air MC965"
harga = "12800000"
ElseIf merk = "MC966" Then
txtmerk = "Apple MacBook Air MC966"
harga = "15800000"
End If
txths = harga
txtjj.SetFocus
End Sub

Private Sub cmdkeluar_Click()
End
End Sub

Private Sub cmdlagi_Click()
cbokode = ""
txtmerk = ""
txths = ""
txtjj = ""
txthp = ""
txtdis = ""
txttb = ""
cbokode.SetFocus
End Sub

Private Sub cmdproses_Click()
Dim harga, dis, total As String
harga = Val(txtjj) * (txths)
txthp = harga
If txthp > "140000000" Then
dis = Val(txthp) * 0.15
ElseIf txthp > "135000000" Then
dis = Val(txthp) * 0.1
ElseIf txthp > "130000000" Then
dis = Val(txthp) * 0.05
ElseIf txthp > "125000000" Then
dis = Val(txthp) * 0.02
End If
txtdis = dis
txttb = Val(txthp) - Val(txtdis)
End Sub

Private Sub Form_Load()
cbokode.AddItem "Apple MC965 MacBook Air"
cbokode.AddItem "Apple MC966 MacBook Air"
cbokode.AddItem "Apple MC968 MacBook Air"
cbokode.AddItem "Apple MC969 MacBook Air"
cbokode.AddItem "Apple MC700 MacBook Pro"
cbokode.AddItem "Apple MC721 MacBook Pro"
cbokode.AddItem "Apple MC723 MacBook Pro"
cbokode.AddItem "Apple MC724 MacBook Pro"
cbokode.AddItem "Apple MC311 MacBook Pro"
cbokode.AddItem "Apple MC313 MacBook Pro"
cbokode.AddItem "Apple MC314 MacBook Pro"
cbokode.AddItem "Apple MC318 MacBook Pro"
cbokode.AddItem "Apple MC322 MacBook Pro"
cbokode.AddItem "Apple MC965 MacBook Air"
cbokode.AddItem "Apple MC966 MacBook Air"
End Sub

Tugas 3.2


Private Sub cmdbatal_Click()
txtnama.SetFocus
txtnama.Text = ""
txtnpm.Text = ""
txtjur.Text = ""
txtps.Text = ""
txttm.Text = ""
txturut.Text = ""
End Sub

Private Sub cmdkeluar_Click()
Unload Me
End Sub

Private Sub cmdlagi_Click()
txtnama.SetFocus
txtnama.Text = ""
txtnpm.Text = ""
txtjur.Text = ""
txtps.Text = ""
txttm.Text = ""
txturut.Text = ""
End Sub

Private Sub cmdproses_Click()
Dim i As String
txttm.Text = "20" & Left(txtnpm.Text, 2)
i = Mid(txtnpm.Text, 3, 1)
If i = "1" Then
txtjur.Text = "Sistem Informasi"
ElseIf i = "2" Then
txtjur.Text = "Manajemen Informatika"
ElseIf i = "3" Then
txtjur.Text = "Teknik Informatika"
ElseIf i = "4" Then
txtjur.Text = "Manajemen & Komp.Akuntansi"
End If

i = Mid(txtnpm.Text, 4, 2)
If i = "01" Then
txtps.Text = "Strata satu"
ElseIf i = "02" Then
txtps.Text = "Diploma 1"
ElseIf i = "03" Then
txtps.Text = "Diploma 2"
ElseIf i = "04" Then
txtps.Text = "Diploma 3"
End If
txturut.Text = Right(txtnpm.Text, 3)
End Sub


Private Sub Form_Activate()
txtnama.SetFocus
txtnama.Text = ""
txtnpm.Text = ""
txtjur.Text = ""
txtps.Text = ""
txttm.Text = ""
txturut.Text = ""
End Sub

Private Sub txtnama_keypress(keyascii As Integer)
If keyascii = 13 Then
txtnpm.SetFocus
End If
End Sub

Tugas 3.1

Private Sub cmdbatal_Click()
kosong
End Sub
Private Sub cmdlagi_Click()
kosong
End Sub
Private Sub Form_Load()
Cbogolongan.AddItem "1"
Cbogolongan.AddItem "11"
Cbogolongan.AddItem "111"
Cbogolongan.AddItem "1V"
End Sub
Private Sub cmdkeluar_Click()
Unload Me
End Sub
Private Sub cbogolongan_Click()
Dim gapok, pajak, tunjangan, total As Variant
Select Case Cbogolongan.Text
Case "1"
gapok = 1500000
tunjangan = 150000
Case "11"
gapok = 2000000
tunjangan = 200000
Case "111"
gapok = 2500000
tunjangan = 250000
Case "1V"
gapok = 3000000
tunjangan = 300000
Case Else
gapok = 0
tunjangan = 0
End Select
total = gapok + tunjangan
pajak = total * 0.1
txtgapok.Text = gapok
txttunjangan.Text = pajak
txtpajak.Text = pajak
txttotal.Text = total - pajak
End Sub

Public Sub kosong()
txtnidn.SetFocus
txtnidn.Text = ""
txtnama.Text = ""
Cbogolongan.Text = ""
txtgapok.Text = ""
txttunjangan.Text = ""
txttotal.Text = ""
txtpajak.Text = ""
End Sub

Private Sub txtnidn_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtnama.SetFocus
End If
End Sub