tugas pemrograman 5

TUGAS 1

12736318_470405199816775_1954116028_n

Private Sub Cmdbatal_Click()

kosong

End Sub

Private Sub cmdlagi_Click()

kosong

End Sub

 

Private Sub Command1_Click()

Adodc1.Recordset.Update

End Sub

 

Private Sub Command2_Click()

Adodc1.Recordset.AddNew

End Sub

 

Private Sub Command4_Click()

Form2.Show

End Sub

 

Private Sub CommandHAPUS_Click()

Adodc1.Recordset.Delete

End Sub

 

Private Sub Form_load()

Cbogolongan.AddItem “I”

Cbogolongan.AddItem “II”

Cbogolongan.AddItem “III”

Cbogolongan.AddItem “IV”

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 “I”

gapok = 1500000

tunjangan = 150000

Case “II”

gapok = 2000000

tunjangan = 200000

Case “III”

gapok = 2500000

tunjangan = 250000

Case “IV”

gapok = 3000000

tunjangan = 300000

Case Else

gapok = 0

tunjangan = 0

End Select

total = gapok + tunjangan

pajak = total * 0.1

Txtgapok.Text = gapok

txttunjangan.Text = tunjangan

Txtpajak.Text = pajak

Txttotal.Text = total – pajak

End Sub

Public Sub kosong()

txtnidn.SetFocus

txtnidn.Text = “”

Txtnama.Text = “”

Cbogolongan.Text = “”

Txtgapok.Text = “”

txttunjangan.Text = “”

Txtpajak.Text = “”

Txttotal.Text = “”

End Sub

 

Private Sub txtnidn_keypress(keyascii As Integer)

If keyascii = 13 Then

Txtnama.SetFocus

End If

End Sub

 

TUGAS 2

12714172_470405203150108_899693441_n

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 S As String

Txttm.Text = “20” & Left(Txtnpm.Text, 2)

S = Mid(Txtnpm.Text, 3, 1)

If S = “1” Then

Txtjur.Text = “Sistem Informasi”

ElseIf S = “2” Then

Txtjur.Text = “Teknik Informatika”

ElseIf S = “3” Then

Txtjur.Text = “Manajemen Informatika”

ElseIf S = “4” Then

Txtjur.Text = “Komputer Akuntansi”

End If

S = Mid(Txtnpm.Text, 4, 2)

If S = “01” Then

Txtps.Text = “Strata Satu”

ElseIf S = “02” Then

Txtps.Text = “Diploma Empat”

ElseIf S = “03” Then

Txtps.Text = “Diploma Tiga”

ElseIf S = “04” Then

Txtps.Text = “Diploma Dua”

End If

Txturut.Text = Right(Txtnpm.Text, 3)

End Sub

 

Private Sub Command1_Click()

Adodc1.Recordset.AddNew

End Sub

 

Private Sub Command2_Click()

Adodc1.Recordset.Update

End Sub

 

Private Sub Command3_Click()

Form2.Show

End Sub

Private Sub Command4_Click()

Adodc1.Recordset.Delete

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

12736096_470151436508818_1675235896_n

Private Sub Command1_Click()

Adodc1.Recordset.AddNew

End Sub

 

Private Sub Command2_Click()

Adodc1.Recordset.Delete

End Sub

 

Private Sub Command3_Click()

Adodc1.Recordset.Update

End Sub

 

Private Sub Command4_Click()

Form2.Show

End Sub

 

Private Sub Form_Activate()

cbokode.SetFocus

cbokode.Text = “”

Txtmerk.Text = “”

Txtsatuan.Text = “”

Txtjumlah.Text = “”

Txtharga.Text = “”

Txtdis.Text = “”

Txttotal.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 MC966 MacBook Air”

cbokode.AddItem “Apple MC968 MacBook Air”

End Sub

Private Sub Cbokode_Click()

Dim s As String

s = Mid(cbokode.Text, 7, 5)

If s = “MC965” Then

Txtmerk = “Apple MacBook Air MC965”

Txtsatuan = “12800000”

ElseIf s = “MC966” Then

Txtmerk = “Apple MacBook Air MC966”

Txtsatuan = “15800000”

ElseIf s = “MC968” Then

Txtmerk = “Apple MacBook Air MC968”

Txtsatuan = “9900000 ”

ElseIf s = “MC969” Then

Txtmerk = “Apple MacBook Air MC969”

Txtsatuan = “11900000”

ElseIf s = “MC700” Then

Txtmerk = “Apple MacBook Pro MC700”

Txtsatuan = “10800000”

ElseIf s = “MC721” Then

Txtmerk = “Apple MacBook Pro MC721”

Txtsatuan = “15900000”

ElseIf s = “MC723” Then

Txtmerk = “Apple MacBook Pro MC723”

Txtsatuan = “19300000”

ElseIf s = “MC724” Then

Txtmerk = “Apple MacBook Pro MC724”

Txtsatuan = “13700000”

ElseIf s = “MC311” Then

Txtmerk = “Apple MacBook Pro MC311”

Txtsatuan = “24200000”

ElseIf s = “MC313” Then

Txtmerk = “Apple MacBook Pro MC313”

Txtsatuan = “11900000”

ElseIf s = “MC314” Then

Txtmerk = “Apple MacBook Pro MC314”

Txtsatuan = “14700000”

ElseIf s = “MC318” Then

Txtmerk = “Apple MacBook Pro MC318”

Txtsatuan = “17600000”

ElseIf s = “MC322” Then

Txtmerk = “Apple MacBook Pro MC322”

Txtsatuan = “21300000”

End If

Txtjumlah.SetFocus

 

End Sub

 

Private Sub cmdproses_click()

Dim harga, dis, total, satuan As Integer

 

 

Txtharga = Val(Txtsatuan) * Val(Txtjumlah)

Txttotal = Val(Txtharga) – Val(Txtdis)

 

 

Select Case Txtsatuan.Text

Case Is > 140000000

dis = 0.15 * Txtharga

Case Is > 135000000

dis = 0.1 * Txtharga

Case Is > 130000000

dis = 0.05 * Txtharga

Case Is > 125000000

dis = 0.02 * Txtharga

 

End Select

Txtdis.Text = dis

End Sub

Private Sub Cmdhitunglagi_Click()

cbokode.SetFocus

cbokode.Text = “”

Txtmerk.Text = “”

Txtsatuan.Text = “”

Txtjumlah.Text = “”

Txtharga.Text = “”

Txtdis.Text = “”

Txttotal.Text = “”

End Sub

Private Sub Cmdkeluar_Click()

Unload Me

End Sub

 

TUGAS 4

tugas per4

Private Sub Cbokode_Click()

Dim jenis As String

Dim satuan, jumlah, harga, dis, bayar As Integer

 

Select Case Cbokode.Text

Case “P205”

jenis = “Pentium II   500 Mega Hz”

satuan = “1500000”

Case “P308”

jenis = “Pentium III 800 Mega Hz ”

satuan = “2100000 ”

Case “P310”

jenis = “Pentium III 1.0 Giga Hz ”

satuan = “3500000 ”

Case “P415”

jenis = “Pentium IV  1.5 Giga Hz”

satuan = “4000000 ”

Case “P417”

jenis = “Pentium V  1.7 Giga Hz ”

satuan = “4200000 ”

Case “P419”

jenis = “Pentium IV  1.9 Giga Hz ”

satuan = “5500000  ”

 

End Select

Txtjenis.Text = jenis

Txtsatuan.Text = satuan

Txtjumlah.SetFocus

End Sub

 

Private Sub Command1_Click()

Adodc1.Recordset.AddNew

End Sub

 

 

Private Sub Command2_Click()

Adodc1.Recordset.Delete

End Sub

 

Private Sub Command3_Click()

Adodc1.Recordset.Update

End Sub

 

Private Sub Command4_Click()

Form2.Show

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

 

Private Sub Cmdproses_Click()

Dim jumlah, harga, dis, bayar As Integer

 

Txtharga = Val(Txtsatuan) * Val(Txtjumlah)

Txtbayar = Val(Txtharga) – Val(Txtdis)

 

Select Case Txtharga.Text

Case Is > 30000000

dis = 0.15 * Txtharga

Case Is > 25000000

dis = 0.1 * Txtharga

Case Is > 10000000

dis = 0.05 * Txtharga

Case Is > 15000000

dis = 0.02 * Txtharga

 

End Select

Txtdis.Text = dis

End Sub

 

Private Sub cmdhitunglagi_click()

Cbokode.SetFocus

Cbokode = “”

Txtjenis = “”

Txtsatuan = “”

Txtjumlah = “”

Txtharga = “”

Txtdis = “”

Txtbayar = “”

End Sub

 

Private Sub cmdclose_click()

End

End Sub

 

TUGAS 5

tugas per5

Private Sub Command1_Click()

Adodc1.Recordset.AddNew

End Sub

 

Private Sub Command2_Click()

Adodc1.Recordset.Delete

End Sub

 

Private Sub Command3_Click()

Adodc1.Recordset.Update

End Sub

 

Private Sub Command4_Click()

Form2.Show

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

Private Sub Cmdproses_Click()

Dim S As String

Txttahun.Text = “20” & Right(Cbokode.Text, 2)

 

S = Mid(Cbokode.Text, 3, 3)

If S = “SIM” Then

Txtjudul = “SistemInformasiManajemen”

Txtpengarang = “YatiNurOktavia”

Txtharga = “75900”

ElseIf S = “EDP” Then

Txtjudul = “ElektronikData Processing”

Txtpengarang = “Imam Tarmizi”

Txtharga = “62000”

ElseIf S = “MNJ” Then

Txtjudul = “Manajemen”

Txtpengarang = “Valentina Mariana Adiwianti”

Txtharga = “42000”

ElseIf S = “CDR” Then

Txtjudul = “Corel Draw”

Txtpengarang = “RiyanSuhandi”

Txtharga = “53000”

ElseIf S = “RPL” Then

Txtjudul = “RekayasaPerangkatLunak”

Txtpengarang = “SintaUmpuSinga”

Txtharga = “83000”

End If

 

S = Left(Cbokode.Text, 1)

If S = “A” Then

Txtpenerbit = “Andi Offset Yogyakarta”

ElseIf S = “I” Then

Txtpenerbit = “Indah Surabaya”

ElseIf S = “S” Then

Txtpenerbit = “SalembaEmpat”

ElseIf S = “E” Then

Txtpenerbit = “Elek Media Komputindo”

ElseIf S = “M” Then

Txtpenerbit = “Maxicom”

 

End If

 

End Sub

Private Sub cmdlagi_click()

Cbokode.SetFocus

Cbokode = “”

Txtjudul = “”

Txtpengarang = “”

Txttahun = “”

Txtpenerbit = “”

Txtharga = “”

End Sub

Private Sub cmdbatal_click()

Cbokode.SetFocus

Cbokode = “”

Txtjudul = “”

Txtpengarang = “”

Txttahun = “”

Txtpenerbit = “”

Txtharga = “”

End Sub

Private Sub cmdkeluar_click()

End

End Sub

 

TUGAS 6

tugas per6

Private Sub Cmdproses_Click()

Dim S As String

Dim Txttotal As Integer

 

S = Left(Txtkode.Text, 3)

If S = “BIM” Then

Txtharga = “50000”

Txtjenis = “BIMA”

Txtjam = “16.00”

ElseIf S = “EKO” Then

Txtharga = “35000”

Txtjenis = “EKONOMI”

Txtjam = “19.00”

ElseIf S = “MUT” Then

Txtharga = “23000”

Txtjenis = “MUTIARA”

Txtjam = “17.00”

ElseIf S = “SEN” Then

Txtharga = “15000”

Txtjenis = “SENJA”

Txtjam = “20.00”

End If

Txtjumlah.SetFocus

 

End Sub

 

Private Sub Command1_Click()

Adodc1.Recordset.AddNew

End Sub

Private Sub Command2_Click()

Adodc1.Recordset.Delete

End Sub

 

Private Sub Command3_Click()

Adodc1.Recordset.Update

End Sub

 

Private Sub Command4_Click()

Form2.Show

End Sub

 

Private Sub txtjumlah_keypress(keyascii As Integer)

If keyascii = 13 Then

 

Txttotal = Val(Txtharga) * Val(Txtjumlah)

End If

End Sub

 

 

Private Sub cmdlagi_click()

Txtkode.SetFocus

Txtkode = “”

Txtharga = “”

Txtjenis = “”

Txtjam = “”

Txtjumlah = “”

Txttotal = “”

End Sub

Private Sub cmdkeluar_click()

End

End Sub

 

TUGAS 7

tugas per7

 

Private Sub Cmdproses_Click()

Dim S As String

Txttahun.Text = “20” & Mid(cbokode.Text, 5, 2)

 

S = Left(cbokode.Text, 3)

If S = “SIM” Then

Txtjudul = “SistemInformasiManajemen”

Txtpengarang = “FadiyaUlfa”

Txtharga = “75900”

ElseIf S = “EDP” Then

Txtjudul = “ElektronikData Processing”

Txtpengarang = “NurulAgustina”

Txtharga = “62000”

ElseIf S = “MNJ” Then

Txtjudul = “Manajemen”

Txtpengarang = “RianHidayat”

Txtharga = “42000”

ElseIf S = “CDR” Then

Txtjudul = “Corel Draw”

Txtpengarang = “SitiNurKhotimah”

Txtharga = “53000”

ElseIf S = “RPL” Then

Txtjudul = “RekayasaPerangkatLunak”

Txtpengarang = “WindaErlianti”

Txtharga = “83000”

End If

 

S = Right(cbokode.Text, 1)

If S = “A” Then

Txtpenerbit = “Andi Offset Yogyakarta”

ElseIf S = “I” Then

Txtpenerbit = “Indah Surabaya”

ElseIf S = “S” Then

Txtpenerbit = “SalembaEmpat”

ElseIf S = “E” Then

Txtpenerbit = “Elek Media Komputindo”

ElseIf S = “M” Then

Txtpenerbit = “Maxicom”

 

End If

 

End Sub

Private Sub cmdlagi_click()

cbokode.SetFocus

cbokode = “”

Txtjudul = “”

Txtpengarang = “”

Txttahun = “”

Txtpenerbit = “”

Txtharga = “”

End Sub

Private Sub cmdbatal_click()

cbokode.SetFocus

cbokode = “”

Txtjudul = “”

Txtpengarang = “”

Txttahun = “”

Txtpenerbit = “”

Txtharga = “”

End Sub

Private Sub cmdkeluar_click()

End

End Sub

 

Private Sub Command1_Click()

Adodc1.Recordset.AddNew

End Sub

Private Sub Command2_Click()

Adodc1.Recordset.Delete

End Sub

 

Private Sub Command3_Click()

Adodc1.Recordset.Update

End Sub

 

Private Sub Command4_Click()

Form2.Show

End Sub

 

TUGAS 8

12596446_470407006483261_502831301_n

Private Sub Cmdproses_Click()

Dim S As String

 

S = Mid(Txtnik.Text, 5, 1)

If S = “A” Then

Txtgol.Text = “A”

Txtjabatan.Text = “Manager”

Txtgaji.Text = “4000000”

Txttunjangan.Text = “1025000”

 

ElseIf S = “B” Then

Txtgol.Text = “B”

Txtjabatan.Text = “Ka.seksi”

Txtgaji.Text = “3500000”

Txttunjangan.Text = “975000”

 

ElseIf S = “C” Then

Txtgol.Text = “C”

Txtjabatan.Text = “staff”

Txtgaji.Text = “3000000”

Txttunjangan.Text = “925000”

 

End If

S = Mid(Txtnik.Text, 7, 1)

If S = “S” Then

Txtkode.Text = “S”

Txtstatus.Text = “Single”

ElseIf S = “M” Then

Txtkode.Text = “M”

Txtstatus.Text = “Menikah”

ElseIf S = “J” Then

Txtkode.Text = “J”

Txtstatus.Text = “Janda”

ElseIf S = “D” Then

Txtkode.Text = “D”

Txtstatus.Text = “Duda”

End If

 

S = Right(Txtnik.Text, 3)

If S = “KEU” Then

Txtbagian.Text = “accounting”

ElseIf S = “ADM” Then

Txtbagian.Text = “administrasi”

ElseIf S = “SDM” Then

Txtbagian.Text = “general affair”

ElseIf S = “EDP” Then

Txtbagian.Text = “IT unit”

ElseIf S = “SPM” Then

Txtbagian.Text = “security”

End If

 

Txttahun.Text = Left(Txtnik.Text, 4)

Txttotal.Text = Val(Txtgaji) + Val(Txttunjangan)

 

End Sub

 

 

Private Sub Cmdbatal_Click()

Txtnama.SetFocus

Txtnama.Text = “”

Txtnik.Text = “”

Txtgol.Text = “”

Txtkode.Text = “”

Txtstatus.Text = “”

Txttahun.Text = “”

Txtjabatan.Text = “”

Txtbagian.Text = “”

Txtgaji.Text = “”

Txttunjangan.Text = “”

Txttotal.Text = “”

End Sub

Private Sub Cmdlagi_Click()

Txtnama.SetFocus

Txtnama.Text = “”

Txtnik.Text = “”

Txtgol.Text = “”

Txtkode.Text = “”

Txtstatus.Text = “”

Txttahun.Text = “”

Txtjabatan.Text = “”

Txtbagian.Text = “”

Txtgaji.Text = “”

Txttunjangan.Text = “”

Txttotal.Text = “”

End Sub

 

 

Private Sub Cmdkeluar_Click()

Unload Me

End Sub

 

Private Sub Command1_Click()

Adodc1.Recordset.AddNew

End Sub

Private Sub Command2_Click()

Adodc1.Recordset.Delete

End Sub

 

Private Sub Command3_Click()

Adodc1.Recordset.Update

End Sub

 

Private Sub Command4_Click()

Form2.Show

End Sub

 

 

Private Sub txtnama_keypress(keyascii As Integer)

If keyascii = 13 Then

Txtnik.SetFocus

End If

End Sub

 

TUGAS 9

tugas per9

 

Private Sub cmdadd_Click()

Adodc1.Recordset.AddNew

End Sub

 

Private Sub cmdcancel_Click()

Adodc1.Recordset.Delete

End Sub

 

Private Sub Cmdhitung_Click()

Txtby = Val(Txthb) * Val(Txtjb)

If Txtjb > 5 Then

Txtpot = Val(Txtby) * 0.02

ElseIf Txtjb <= 5 Then

Txtpot = “0”

End If

Txtttb = Val(Txtby) – Val(Txtpot)

End Sub

 

Private Sub cmdkeluar_Click()

Form2.Show

End Sub

 

Private Sub Cmdproses_Click()

Dim S As String

 

S = Mid(Txtkode.Text, 5, 2)

If S = “SP” Then

Txtnb = “spidol”

Txthb = “9500”

ElseIf S = “BT” Then

Txtnb = “buku tulis”

Txthb = “12500”

ElseIf S = “TP” Then

Txtnb = “tip ex”

Txthb = “3000”

ElseIf S = “PG” Then

Txtnb = “penggaris”

Txthb = “25000”

ElseIf S = “PT” Then

Txtnb = “papan tulis”

Txthb = “50000”

End If

Txtjb.SetFocus

End Sub

 

Private Sub cmdsave_Click()

Adodc1.Recordset.Update

End Sub

 

 

tugas per99

Private Sub cmdno_Click()

Form1.Show

End Sub

Private Sub cmdyes_Click()

End

End Sub

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s