tugas 4.5

ENTRI PNJUALAN LPTOP
Private Sub cbokode_Click()
kode = Mid(cbokode.Text, 7, 5)
If kode = “MC965” Then
txtmerk = “Apple MacBook Air ” & Mid(cbokode.Text, 7, 5)
txths = “12800000”
ElseIf kode = “MC966” Then
txtmerk = “Apple MacBook Air ” & Mid(cbokode.Text, 7, 5)
txths = “15800000”
ElseIf kode = “MC968” Then
txtmerk = “Apple MacBook Air ” & Mid(cbokode.Text, 7, 5)
txths = “9900000”
ElseIf kode = “MC969” Then
txtmerk = “Apple MacBook Air ” & Mid(cbokode.Text, 7, 5)
txths = “11900000”
ElseIf kode = “MC700” Then
txtmerk = “Apple MacBook Pro ” & Mid(cbokode.Text, 7, 5)
txths = “10800000”
ElseIf kode = “MC721” Then
txtmerk = “Apple MacBook Pro ” & Mid(cbokode.Text, 7, 5)
txths = “15900000”
ElseIf kode = “MC723” Then
txtmerk = “Apple MacBook Pro ” & Mid(cbokode.Text, 7, 5)
txths = “19300000”
ElseIf kode = “MC724” Then
txtmerk = “Apple MacBook Pro ” & Mid(cbokode.Text, 7, 5)
txths = “13700000”
ElseIf kode = “MC311” Then
txtmerk = “Apple MacBook Pro ” & Mid(cbokode.Text, 7, 5)
txths = “24200000”
ElseIf kode = “MC313” Then
txtmerk = “Apple MacBook Pro ” & Mid(cbokode.Text, 7, 5)
txths = “11900000”
ElseIf kode = “MC314” Then
txtmerk = “Apple MacBook Pro ” & Mid(cbokode.Text, 7, 5)
txths = “14700000”
ElseIf kode = “MC318” Then
txtmerk = “Apple MacBook Pro ” & Mid(cbokode.Text, 7, 5)
txths = “17600000”
ElseIf kode = “MC322” Then
txtmerk = “Apple MacBook Pro ” & Mid(cbokode.Text, 7, 5)
txths = “21300000”
End If
txtjj.SetFocus
End Sub

Private Sub cmdkeluar_Click()
p = MsgBox(“Anda yakin akan keluar?”, vbQuestion + vbOKCancel, “Informasi”)
If p = vbOK Then
End
End If
End Sub

Private Sub cmdlagi_Click()
cbokode.SetFocus
cbokode = “”
txtmerk = “”
txths = “”
txtjj = “”
txthp = “”
txtdis = “”
txttb = “”

End Sub

Private Sub cmdproses_Click()
txthp = Val(txths.Text) * Val(txtjj.Text)
If txthp >= 140000000 Then
txtdis = Val(txthp.Text) * 0.15
ElseIf txthp >= 135000000 Then
txtdis = Val(txthp.Text) * 0.1
ElseIf txthp >= 130000000 Then
txtdis = Val(txthp.Text) * 0.05
ElseIf txthp >= 125000000 Then
txtdis = Val(txthp.Text) * 0.02
End If
txttb = Val(txthp.Text) – Val(txtdis.Text)
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

Private Sub Label12_Click()

End Sub

Iklan

TUGAS 4.4

JURUSAN

Private Sub CMDKELUAR_Click()
Unload Me
End Sub

Private Sub CMDLAGI_Click()
TxtNAMAText.SetFocus
TXTNAM = “”
TxtNPM = “”
TxtJURUSAN = “”
TxtPS = “”
TxtTM = “”
TxtNOURUT = “”
End Sub

Private Sub CMDPROSES_Click()
Dim S As String
TxtNPM.Text = 20 & Left(TxtNPM.Text, 2)
S = Mid(TxtNPM, 3, 1)
If S = “1” Then
TxtJURUSAN.Text = “SISTEM INFORMASI”
ElseIf S = “2” Then
TxtJURUSAN.Text = “MANAJENEN INFORMATIKA”
ElseIf S = “3” Then
TxtJURUSAN.Text = “TEKNIK INFORMATIKA”
ElseIf S = “4” Then
TxtJURUSAN.Text = “AKUNTANSI MAJEJEMENT”
End If
S = Mid(TxtNPM, 4, 2)
If S = ” 01″ Then
TxtPS.Text = “STRATA SATU”
ElseIf S = “02” Then
TxtPS.Text = “DIPLOMA 3”
ElseIf S = “03” Then
TxtPS.Text = “DIPLOMA 4”
ElseIf S = “4” Then
TxtPS.Text = “DIPLOMA 2”
End If
TxtNOURUT.Text = Right(TxtNPM, 3)
End Sub

TUGAS4.3

pt berjuang
Private Sub CMDKELUAR_Click()
Unload Me
End Sub

Private Sub CMDLAGI_Click()
Txtgol.SetFocus
Txtgol = “”
Txtks = “”
Txtstts = “”
Txttahun = “”
Txtjabatan = “”
Txtbagian = “”
Txtgajip = “”
Txttunjangan = “”
Txttotalg = “”
Txtnama = “”
Txtnik = “”
End Sub

Private Sub CMDPROSES_Click()
Dim S As Variant
Txttahun.Text = Left(Txtnik.Text, 4)
Txtgol.Text = Mid(Txtnik.Text, 5, 1)
If S = A Then
Txtgol.Text = “A”
ElseIf S = B Then
Txtgol.Text = “B”
ElseIf S = C Then
Txtgol.Text = “C”
End If
Txtks.Text = Mid(Txtnik.Text, 5, 1)
If S = M Then
Txtks.Text = “M”
ElseIf S = S Then
Txtks.Text = “S”
ElseIf S = J Then
Txtks.Text = “J”
ElseIf S = D Then
Txtks.Text = “J”
End If
Txtjabatan.Text = Mid(Txtnik.Text, 5, 1)
If S = A Then
Txtjabatan.Text = “MANAJER”
If S = B Then
Txtjabatan.Text = “KEPALA SEKSI”
ElseIf S = C Then
Txtjabatan.Text = “STAF”
End If
Txtbagian.Text = Mid(Txtnik.Text, 9, 3)
If S = KUE Then
Txtbagian.Text = “ACCOUNTING”
ElseIf S = ADM Then
Txtbagian.Text = “ADMINISTRATION”
ElseIf S = SDM Then
Txtbagian.Text = “GENERAL AFFAIR”
ElseIf S = EDP Then
Txtbagian.Text = “IT UNIT”
ElseIf S = SPM Then
Txtbagian.Text = “SECCURITY”
End If
Txttunjangan.Text = Mid(Txtnik.Text, 5, 1)
If S = A Then
Txttunjangan.Text = “1.025000”
ElseIf S = B Then
Txttunjangan.Text = “975000”
ElseIf S = C Then
Txttunjangan.Text = “925000”
End If
Txtgajip.Text = Mid(Txtnik.Text, 5, 1)
If S = A Then
Txtgajip.Text = 4000000
ElseIf S = B Then
Txtgajip.Text = “350000”
ElseIf S = C Then
Txtgajip = “3000000”
End If
Txtstts.Text = Mid(Txtnik.Text, 7, 1)
If S = M Then
Txtstts.Text = “MENIKAH”
ElseIf S = S Then
Txtstts.Text = “SINGGEL”
ElseIf S = J Then
Txtstts.Text = “JANDA”
ElseIf S = D Then
Txtstts.Text = “DUDA”
End If
Txttotalg.Text = Val(Txtgajip.Text) + Val(Txttunjangan.Text)
Txttotalg.Text = Txttotalg
End If
End Sub

Private Sub Txtgol_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Txtnama.SetFocus
End If
End Sub

Private Sub Txtnama_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Txtnik.SetFocus
End If
End Sub

tugas 4.2

penghitungan gaji

Private Sub Cbogolongan_Click()
Dim GajiPokok, PaJak, TunjanganJ, TotalTerima As Double
Select Case Cbogolongan.Text
Case “I”
Txtgp.Text = “2000000”
Txttj.Text = “2000000”
Case “II”
Txtgp.Text = “2500000”
Txttj.Text = “2500000”
Case “III”
Txtgp.Text = “3000000”
Txttj.Text = “3000000′”
Case “IV”
Txtgp.Text = “3500000”
Txttj.Text = “3500000”
Case Else
Txtgp = “0”
Txttj = “0”
End Select
Txttt.Text = Val(Txtgp.Text) + Val(Txttj.Text) – Val(Txtpj.Text)
Txtpj.Text = Val(Txttj.Text) * 0.1
Txttt.Text = Val(Txttj.Text) – Val(Txtpj.Text)
End Sub

Private Sub CMDBATAL_Click()
Txtnidn.SetFocus
Txtnidn = “”
Txtnp = “”
Cbogolongan = “”
Txtgp = “”
Txttj = “”
Txtpj = “”
Txttt = “”
End Sub

Private Sub CMDKELUAR_Click()
Unload Me
End Sub

Private Sub CMDLAGI_Click()
Txtnidn.SetFocus
Txtnidn = “”
Txtnp = “”
Cbogolongan = “”
Txtgp = “”
Txttj = “”
Txtpj = “”
Txttt = “”

End Sub

Private Sub Form_Load()
Cbogolongan.AddItem “I”
Cbogolongan.AddItem “II”
Cbogolongan.AddItem “III”
Cbogolongan.AddItem “IV”

End Sub

Private Sub Txtnidn_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Txtnp.SetFocus
End If
End Sub

tugas 4.1

tulis nama

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

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

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

TUGASVB 8

GA7

TULISKAN  NAMA ANDA

Private Sub Check2_Click()

 Label2.FontItalic = Check2.Value

End Sub

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