Tugas B. Pemrograman 2 smtr 3

DATABASE PENJUALAN KOMPUTER

 

SDSDSD.PNG

 

Private Sub cbokode_Click()
KL = Right(cbokode, 5)
Dim JK, HS, JJ, HP, DIS, TP As String
cbokode = Right(cbokode, 5)
Select Case cbokode
Case “P205”
JK = “Pentium II 500 Mega Hz”
HS = “1.500.000”
Case “P308”
JK = “Pentium III 800 Mega Hz”
HS = “2.100.000”
Case “P310”
JK = “Pentium III 1.0 Giga Hz”
HS = “3.500.000”
Case “P415”
JK = “Pentium IV 1.5 Giga Hz”
HS = “4.000.000”
Case “P417”
JK = “Pentium IV 1.7 Giga Hz”
HS = “4.200.000”
Case “P419”
JK = “Pentium IV 1.9 Giga Hz”
HS = “5.500.000”
End Select

 

cbokode.Text = (cbokode.Text)
txtjj.SetFocus
txtjk = JK
txths = HS
txtjj = JJ
txthp = HP
txtdis = DIS
txttp = TP

End Sub

 

Private Sub cmdbaru_Click()
Data1.Recordset.AddNew
End Sub

 

Private Sub cmdhapus_Click()
Data1.Recordset.Delete
End Sub

 

Private Sub cmdkeluar_Click()
If MsgBox(“Serius Bro Mau Keluar?”, vbQuestion + vbYesNo, “quit”) = vbYes Then
End
End If
End Sub

 

Private Sub cmdlagi_Click()
cbokode = “(pilih kode)”
txtjk = “”
txths = “”
txtjj = “”
txthp = “”
txtdis = “”
txttp = “”
txtprs = “”
End Sub

 

Private Sub cmdproses_Click()
txthp = txths * txtjj
If txthp > 40000000 Then
txtdis = txthp * 0.15
txttp = txthp – txtdis
txtprs = “15%”
ElseIf txthp > 35000000 Then
txtdis = txthp * 0.1
txttp = txthp – txtdis
txtprs = “10%”
ElseIf txthp > 30000000 Then
txtdis = txthp * 0.05
txttp = txthp – txtdis
txtprs = “5%”
ElseIf txthp > 25000000 Then
txtdis = txthp * 0.02
txttp = txthp – txtdis
txtprs = “2%”
ElseIf txthp > 0 Then
txtdis = txthp * 0
txttp = txthp – txtdis
txtprs = “0%”
End If
End Sub

 

Private Sub cmdsimpan_Click()
Data1.Recordset.Update
End Sub

 

Private Sub Form_Load()
cbokode.AddItem “P205”
cbokode.AddItem “P308”
cbokode.AddItem “P310”
cbokode.AddItem “P415”
cbokode.AddItem “P417”
cbokode.AddItem “P419”

End Sub

Iklan

TUGAS DATABASE 13 PROGRAM

PROGRAM 13

TUGAS M

Private Sub cmdadd_Click()
Data1.Recordset.AddNew
txtkb.SetFocus
End Sub

Private Sub cmdbatal_Click()
Data1.Recordset.Delete
End Sub

Private Sub cmdhitung_Click()
txtby = txthb * txtjb
txtptong = txtby * 0.02
txttb = txtby – txtptong
End Sub

Private Sub cmdkeluar_Click()
If MsgBox(“Serius Bro Mau Keluar?”, vbQuestion + vbYesNo, “Quit”) = vbYes Then
End
End If
End Sub

Private Sub cmdproses_Click()
Dim NB, HB, KB, JB, BY, PTO, TB As String
KB = Mid(txtkb, 5, 2)
If KB = “SP” Then
NB = “SPIDOL”
HB = “9500”
ElseIf KB = “BT” Then
NB = “BUKU TULIS”
HB = “12500”
ElseIf KB = “TP” Then
NB = “TIPEX”
HB = “3000”
ElseIf KB = “PG” Then
NB = “PENGGARIS”
HB = “25000”
ElseIf KB = “PT” Then
NB = “PAPAN TULIS”
HB = “50000”
End If
txtkb = Val(txtkb)
txtjb.SetFocus
txtkb = KB
txtnb = NB
txthb = HB
txtby = BY
txtptong = PTO
txttb = TB

End Sub

Private Sub cmdsimpan_Click()
Data1.Recordset.Update
End Sub
Private Sub txtkb_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Dim NB, HB, KB, JB, BY, PTO, TB As String
KB = Mid(txtkb, 5, 2)
If KB = “SP” Then
NB = “SPIDOL”
HB = “9500”
ElseIf KB = “BT” Then
NB = “BUKU TULIS”
HB = “12500”
ElseIf KB = “TP” Then
NB = “TIPEX”
HB = “3000”
ElseIf KB = “PG” Then
NB = “PENGGARIS”
HB = “25000”
ElseIf KB = “PT” Then
NB = “PAPAN TULIS”
HB = “50000”
End If
txtkb = Val(txtkb)
txtjb.SetFocus
txtkb = KB
txtnb = NB
txthb = HB
txtby = BY
txtptong = PTO
txttb = TB
txtby = Val(txthb.Text) * Val(txtjb.Text)
txtptong = Val(txtjb.Text) * 0.02
txttb = Val(txtjb.Text) – Val(txtptong.Text)
End If
End Sub

TUGAS DATABASE 13 PROGRAM

PROGRAM 12

TUGAS L

Private Sub cmdbaru_Click()
Data1.Recordset.AddNew
txtnama.SetFocus
End Sub

Private Sub cmdbatal_Click()
txtnama.SetFocus
txtnama = “”
txtnpm = “”
txtjur = “”
txtps = “”
txttm = “”
txtnu = “”
End Sub

Private Sub cmdhapus_Click()
Data1.Recordset.Delete
End Sub

Private Sub cmdkeluar_Click()
If MsgBox(“Serius Bro Mau Keluar?”, vbQuestion + vbYesNo, “quit”) = vbYes Then
End
End If
End Sub

Private Sub cmdlagi_Click()
txtnama.SetFocus
txtnama = “”
txtnpm = “”
txtjur = “”
txtps = “”
txttm = “”
txtnu = “”
End Sub

Private Sub cmdproses_Click()
Dim NPM, JUR, PS, TM As String
TM = “20” + Left(txtnpm, 2)
NPM = Mid(txtnpm, 3, 1)
If NPM = “1” Then
JUR = “Sistem Informasi”
ElseIf NPM = “2” Then
JUR = “Teknik Informatika”
ElseIf NPM = “3” Then
JUR = “Manajemen Informatika”
ElseIf NPM = “4” Then
JUR = “Manajemen & Komputer Akutansi”
End If

NPM = Mid(txtnpm, 4, 2)
If NPM = “00” Or “01” Then
PS = “Strata Satu”
ElseIf NPM = “02” Then
PS = “Diploma Empat”
ElseIf NPM = “03” Then
PS = “Diploma Tiga”
ElseIf NPM = “04” Then
PS = “Diploma Dua”
End If

NPM = (txtnpm)
txtnpm = NPM
txtjur = JUR
txtps = PS
txttm = TM
End Sub

Private Sub cmdsimpan_Click()
Data1.Recordset.Update
End Sub

Private Sub txtnama_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtnpm.SetFocus
End If
End Sub

Private Sub txtnpm_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Dim NPM, JUR, PS, TM As String
TM = “20” + Left(txtnpm, 2)
NPM = Mid(txtnpm, 3, 1)
If NPM = “1” Then
JUR = “Sistem Informasi”
ElseIf NPM = “2” Then
JUR = “Teknik Informatika”
ElseIf NPM = “3” Then
JUR = “Manajemen Informatika”
ElseIf NPM = “4” Then
JUR = “Manajemen & Komputer Akutansi”
End If

NPM = Mid(txtnpm, 4, 2)
If NPM = “00” Or “01” Then
PS = “Strata Satu”
ElseIf NPM = “02” Then
PS = “Diploma Empat”
ElseIf NPM = “03” Then
PS = “Diploma Tiga”
ElseIf NPM = “04” Then
PS = “Diploma Dua”
End If

NPM = (txtnpm)
txtnpm = NPM
txtjur = JUR
txtps = PS
txttm = TM
txtnu = NU
End If
End Sub

TUGAS DATABASE 13 PROGRAM

PROGRAM 11

TUGAS K

Private Sub cbogol_Click()
Dim GP, TJ, PJ, TT As String
Select Case cbogol
Case “I”
GP = “1500000”
TJ = “150000”
Case “II”
GP = “2000000”
TJ = “200000”
Case “III”
GP = “2500000”
TJ = “250000”
Case “IV”
GP = “3000000”
TJ = “300000”
Case Else
GP = “0”
TJ = “0”
End Select
txtgp = GP
txttj = TJ
txtpj = PJ
txttt = TT
PJ = Val(txtgp + txttj) * 0.1
TT = Val(txtgp + txttj) – Val(txtpj)

End Sub

Private Sub cmdbaru_Click()
Data1.Recordset.AddNew
txtnidn.SetFocus
End Sub

Private Sub cmdbatal_Click()
txtnidn.SetFocus
txtnidn = “”
txtnp = “”
cbogol = “”
txtgp = “”
txttj = “”
txtpj = “”
txttt = “”

End Sub

Private Sub cmdhapus_Click()
Data1.Recordset.Delete
End Sub

Private Sub cmdkeluar_Click()
If MsgBox(“Serius Bro Mau Keluar?”, vbQuestion + vbYesNo, “quit”) = vbYes Then
End
End If
End Sub

Private Sub cmdlagi_Click()
txtnidn.SetFocus
txtnidn = “”
txtnp = “”
cbogol = “”
txtgp = “”
txttj = “”
txtpj = “”
txttt = “”

End Sub

Private Sub cmdsimpan_Click()
Data1.Recordset.Update
End Sub

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

End Sub

TUGAS DATABASE 13 PROGRAM

PROGRAM 10

TUGAS J

Private Sub cmdbaru_Click()
Data1.Recordset.AddNew
txtnama.SetFocus
End Sub

Private Sub cmdbatal_Click()
txtnama.SetFocus
txtnama = “”
txtnpm = “”
txtjur = “”
txtps = “”
txttm = “”
txtnu = “”
End Sub

Private Sub cmdhapus_Click()
Data1.Recordset.Delete
End Sub

Private Sub cmdkeluar_Click()
If MsgBox(“Serius Bro Mau Keluar?”, vbQuestion + vbYesNo, “quit”) = vbYes Then
End
End If
End Sub

Private Sub cmdlagi_Click()
txtnama.SetFocus
txtnama = “”
txtnpm = “”
txtjur = “”
txtps = “”
txttm = “”
txtnu = “”
End Sub

Private Sub cmdproses_Click()
Dim NPM, JUR, PS, TM, NU As String
TM = “20” + Left(txtnpm, 2)
NPM = Mid(txtnpm, 3, 1)
If NPM = “1” Then
JUR = “Sistem Informasi”
ElseIf NPM = “2” Then
JUR = “Teknik Informatika”
ElseIf NPM = “3” Then
JUR = “Manajemen Informatika”
ElseIf NPM = “4” Then
JUR = “Manajemen & Komputer Akutansi”
End If

NPM = Mid(txtnpm, 4, 2)
If NPM = “00” Or “01” Then
PS = “Strata Satu”
ElseIf NPM = “02” Then
PS = “Diploma Empat”
ElseIf NPM = “03” Then
PS = “Diploma Tiga”
ElseIf NPM = “04” Then
PS = “Diploma Dua”
End If

NU = Right(txtnpm, 3)
NPM = (txtnpm)
txtnpm = NPM
txtjur = JUR
txtps = PS
txttm = TM
txtnu = NU
End Sub

Private Sub cmdsimpan_Click()
Data1.Recordset.Update
End Sub

Private Sub txtnama_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtnpm.SetFocus
End If
End Sub

Private Sub txtnpm_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Dim NPM, JUR, PS, TM, NU As String
TM = “20” + Left(txtnpm, 2)
NPM = Mid(txtnpm, 3, 1)
If NPM = “1” Then
JUR = “Sistem Informasi”
ElseIf NPM = “2” Then
JUR = “Teknik Informatika”
ElseIf NPM = “3” Then
JUR = “Manajemen Informatika”
ElseIf NPM = “4” Then
JUR = “Manajemen & Komputer Akutansi”
End If

NPM = Mid(txtnpm, 4, 2)
If NPM = “00” Or “01” Then
PS = “Strata Satu”
ElseIf NPM = “02” Then
PS = “Diploma Empat”
ElseIf NPM = “03” Then
PS = “Diploma Tiga”
ElseIf NPM = “04” Then
PS = “Diploma Dua”
End If

NU = Right(txtnpm, 3)
NPM = (txtnpm)
txtnpm = NPM
txtjur = JUR
txtps = PS
txttm = TM
txtnu = NU
End If
End Sub

TUGAS DATABASE 13 PROGRAM

PROGRAM 09

TUGAS I

Private Sub cmdbaru_Click()
Data1.Recordset.AddNew
txtnk.SetFocus
End Sub

Private Sub cmdbatal_Click()
txtnk.SetFocus
txtnk = “”
txtnik = “”
txtgol = “”
txtks = “”
txtstat = “”
txtth = “”
txtjb = “”
txtbg = “”
txtgp = “”
txttj = “”
txttg = “”

End Sub

Private Sub cmdhapus_Click()
Data1.Recordset.Delete
End Sub

Private Sub cmdkeluar_Click()
If MsgBox(“Serius Bro Mau Keluar?”, vbQuestion + vbYesNo, “quit”) = vbYes Then
End
End If
End Sub

Private Sub cmdlagi_Click()
txtnk.SetFocus
txtnk = “”
txtnik = “”
txtgol = “”
txtks = “”
txtstat = “”
txtth = “”
txtjb = “”
txtbg = “”
txtgp = “”
txttj = “”
txttg = “”

End Sub

Private Sub cmdproses_Click()
Dim GOL, KS, ST, TH, JB, BG, GP, TJ, TG, NIK As Integer
TH = Left(txtnik, 4)
GOL = Mid(txtnik, 5, 1)
If GOL = “A” Then
JB = “Manajer”
GP = “4.000.000”
TJ = “1.025.000”
ElseIf GOL = “B” Then
JB = “Ka. Seksi”
GP = “3.500.000”
TJ = “975.000”
ElseIf GOL = “C” Then
JB = “Staff”
GP = “3.000.000”
TJ = “925.000”
End If

ST = Mid(txtnik, 7, 1)
If ST = “S” Then
ST = “Single”
KS = “S”
ElseIf ST = “M” Then
ST = “Menikah”
KS = “M”
ElseIf ST = “J” Then
ST = “Janda”
KS = “J”
ElseIf ST = “D” Then
ST = “Duda”
KS = “D”
End If

BG = Right(txtnik, 3)
If BG = “KEU” Then
BG = “Accounting”
ElseIf BG = “ADM” Then
BG = “Administrasi”
ElseIf BG = “SDM” Then
BG = “General Affair”
ElseIf BG = “EDP” Then
BG = “IT Unit”
ElseIf BG = “SPM” Then
BG = “Security”
End If

TG = txttj + txtgp
txtgol = GOL
txtks = KS
txtstat = ST
txtth = TH
txtjb = JB
txtbg = BG
txtgp = GP
txttj = TJ
txttg = TG
txtnik = NIK
End Sub

Private Sub cmdsimpan_Click()
Data1.Recordset.Update
End Sub

Private Sub txtnk_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtnik.SetFocus
End If
End Sub

TUGAS DATABASE 13 PROGRAM

PROGRAM 08

TUGAS H

Private Sub cbokode_Click()
KL = Right(cbokode, 5)
Dim JK, HS, JJ, HP, DIS, TP As String
cbokode = Right(cbokode, 5)
Select Case cbokode
Case “P205”
JK = “Pentium II 500 Mega Hz”
HS = “1.500.000”
Case “P308”
JK = “Pentium III 800 Mega Hz”
HS = “2.100.000”
Case “P310”
JK = “Pentium III 1.0 Giga Hz”
HS = “3.500.000”
Case “P415”
JK = “Pentium IV 1.5 Giga Hz”
HS = “4.000.000”
Case “P417”
JK = “Pentium IV 1.7 Giga Hz”
HS = “4.200.000”
Case “P419”
JK = “Pentium IV 1.9 Giga Hz”
HS = “5.500.000”
End Select

cbokode.Text = (cbokode.Text)
txtjj.SetFocus
txtjk = JK
txths = HS
txtjj = JJ
txthp = HP
txtdis = DIS
txttp = TP

End Sub

Private Sub cmdbaru_Click()
Data1.Recordset.AddNew
cbokode = “(pilih kode)”
End Sub

Private Sub cmdhapus_Click()
Data1.Recordset.Delete
End Sub

Private Sub cmdkeluar_Click()
If MsgBox(“Serius Bro Mau Keluar?”, vbQuestion + vbYesNo, “quit”) = vbYes Then
End
End If
End Sub

Private Sub cmdlagi_Click()
cbokode = “(pilih kode)”
txtjk = “”
txths = “”
txtjj = “”
txthp = “”
txtdis = “”
txttp = “”
txtprs = “”
End Sub

Private Sub cmdproses_Click()
txthp = txths * txtjj
If txthp > 40000000 Then
txtdis = txthp * 0.15
txttp = txthp – txtdis
txtprs = “15%”
ElseIf txthp > 35000000 Then
txtdis = txthp * 0.1
txttp = txthp – txtdis
txtprs = “10%”
ElseIf txthp > 30000000 Then
txtdis = txthp * 0.05
txttp = txthp – txtdis
txtprs = “5%”
ElseIf txthp > 25000000 Then
txtdis = txthp * 0.02
txttp = txthp – txtdis
txtprs = “2%”
ElseIf txthp > 0 Then
txtdis = txthp * 0
txttp = txthp – txtdis
txtprs = “0%”
End If
End Sub

Private Sub cmdsimpan_Click()
Data1.Recordset.Update
End Sub

Private Sub Form_Load()
cbokode.AddItem “P205”
cbokode.AddItem “P308”
cbokode.AddItem “P310”
cbokode.AddItem “P415”
cbokode.AddItem “P417”
cbokode.AddItem “P419”

End Sub