TUGAS PEMROGRAMAN 1

TUGAS 1

1

Private Sub cbogol_Click()

Dim GOLONGAN, Gajipokok, Tunjangan, PAJAK, TOTAL As Variant

GOLONGAN = cbogol

Select Case GOLONGAN

Case “I”

Gajipokok = “1500000”

Tunjangan = “150000”

Case “II”

Gajipokok = “2000000”

Tunjangan = “200000”

Case “III”

Gajipokok = “2500000”

Tunjangan = “250000”

Case “IV”

Gajipokok = “3000000”

Tunjangan = “300000”

End Select

txtgp = Gajipokok

txttunj = Tunjangan

PAJAK = (Gajipokok + Tunjangan) * 0.1

txtpajak = PAJAK

TOTAL = Gajipokok + Tunjangan – PAJAK

txttotal = TOTAL

End Sub

 

Private Sub cmdbatal_Click()

txtnidn.SetFocus

txtnidn.Text = “”

txtnm.Text = “”

cbogol.Text = “pilih golongan”

txtgp.Text = “”

txttunj.Text = “”

txtpajak.Text = “”

txttotal.Text = “”

End Sub

 

Private Sub cmdkeluar_Click()

Unload Me

End Sub

 

Private Sub Cmdlg_Click()

txtnidn.SetFocus

txtnidn.Text = “”

txtnm.Text = “”

cbogol.Text = “pilih golongan”

txtgp.Text = “”

txttunj.Text = “”

txtpajak.Text = “”

txttotal.Text = “”

End Sub

 

Private Sub Command1_Click()

Data1.Recordset.AddNew

Data1.Recordset.Update

Data1.Recordset.MoveLast

End Sub

 

Private Sub Command2_Click()

Data1.Recordset.AddNew

Data1.Recordset.Update

Data1.Recordset.MoveNext

End Sub

 

Private Sub Command3_Click()

txtnidn.SetFocus

txtnidn.Text = “”

txtnm.Text = “”

cbogol.Text = “pilih golongan”

txtgp.Text = “”

txttunj.Text = “”

txtpajak.Text = “”

txttotal.Text = “”

End Sub

 

Private Sub Command4_Click()

Data1.Recordset.Delete

End Sub

 

Private Sub Form_Load()

cbogol.AddItem “I”

cbogol.AddItem “II”

cbogol.AddItem “III”

cbogol.AddItem “IV”

End Sub

 

Private Sub txtnidn_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

txtnm.SetFocus

End If

End Sub

 

Private Sub txtnm_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

cbogol.SetFocus

End If

End Sub

 

 

TUGAS 2

2.PNG

Private Sub cmdadd_Click()

Data1.Recordset.AddNew

Data1.Recordset.Update

Data1.Recordset.MoveLast

 

End Sub

 

Private Sub cmdbatal_Click()

txtnm.SetFocus

txtnm.Text = “”

txtnpm.Text = “”

txtjuru.Text = “”

txtps.Text = “”

txtmasuk.Text = “”

txtno.Text = “”

End Sub

 

Private Sub cmdhapus_Click()

Data1.Recordset.Delete

End Sub

 

Private Sub cmdkeluar_Click()

Unload Me

End Sub

 

Private Sub cmdlagi_Click()

txtnm.SetFocus

txtnm.Text = “”

txtnpm.Text = “”

txtjuru.Text = “”

txtps.Text = “”

txtmasuk.Text = “”

txtno.Text = “”

End Sub

 

Private Sub cmdproses_Click()

Dim A As String

txtmasuk.Text = “20” & Left(txtnpm.Text, 2)

A = Mid(txtnpm, 3, 1)

If A = “1” Then

txtjuru = “Sistem Informasi”

txtps = “Strata Satu”

ElseIf A = “2” Then

txtjuru = “Tekhnik Informatika”

txtps = “Diploma Empat”

ElseIf A = “3” Then

txtjuru = “Manajemen Informatika”

txtps = “Diploma Tiga”

ElseIf A = “4” Then

txtjuru = “Komputer Akuntansi”

txtps = “Diploma Dua”

End If

txtmasuk = Left(txtnpm, 2)

txtno = Right(txtnpm, 4)

End Sub

 

Private Sub cmdsave_Click()

Data1.Recordset.AddNew

Data1.Recordset.Update

Data1.Recordset.MoveNext

 

End Sub

 

Private Sub txtnm_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

txtnpm.SetFocus

End If

End Sub

 

TUGAS 3

3

Private Sub CboKode_Click()

Dim Merk, Satuan As Variant

Select Case CboKode.Text

Case “Apple MC965 MacBook Air”

Merk = “Apple MacBook Air MC965”

Satuan = 12800000

Case “Apple MC966 MacBook Air”

Merk = “Apple MacBook Air MC966”

Satuan = 15800000

Case “Apple MC968 MacBook Air”

Merk = “Apple MacBook Air MC965”

Satuan = 9900000

Case “Apple MC969 MacBook Air”

Merk = “Apple MacBook Air MC969”

Satuan = 11900000

Case “Apple MC700 MacBook Pro”

Merk = “Apple MacBook Pro MC700”

Satuan = 10800000

Case “Apple MC721 MacBook Pro”

Merk = “Apple MacBook Pro MC721”

Satuan = 15900000

Case “Apple MC723 MacBook Pro”

Merk = “Apple MacBook Pro MC723”

Satuan = 19300000

Case “Apple MC724 MacBook Pro”

Merk = “Apple MacBook Pro MC724”

Satuan = 13700000

Case “Apple MC311 MacBook Pro”

Merk = “Apple MacBook Pro MC311”

Satuan = 24200000

Case “Apple MC313 MacBook Pro”

Merk = “Apple MacBook Pro MC313”

Satuan = 11900000

Case “Apple MC314 MacBook Pro”

Merk = “Apple MacBook Pro MC314”

Satuan = 14700000

Case “Apple MC318 MacBook Pro”

Merk = “Apple MacBook Pro MC318”

Satuan = 17600000

Case “Apple MC322 MacBook Pro”

Merk = “Apple MacBook Pro MC322”

Satuan = 21300000

Case “Apple MC965 MacBook Pro”

Merk = “Apple MacBook Pro MC965”

Satuan = 12800000

Case “Apple MC966 MacBook Pro”

Merk = “Apple MacBook Pro MC966”

Satuan = 15800000

End Select

TxtMerk.Text = Merk

TxtHS.Text = Satuan

End Sub

 

Private Sub cmdadd_Click()

Data1.Recordset.AddNew

Data1.Recordset.Update

Data1.Recordset.MoveLast

End Sub

 

Private Sub cmdbatal_Click()

CboKode.SetFocus

CboKode = “Kode Laptop”

TxtMerk = “”

TxtHS = “”

TxtTotal = “”

TxtHargaPen = “”

TxtDis = “”

TxtTotal = “”

TxtJJual = “”

End Sub

 

Private Sub cmdhapus_Click()

Data1.Recordset.Delete

End Sub

 

Private Sub CmdHL_Click()

CboKode.SetFocus

CboKode = “Kode Laptop”

TxtMerk = “”

TxtHS = “”

TxtTotal = “”

TxtHargaPen = “”

TxtDis = “”

TxtTotal = “”

TxtJJual = “”

End Sub

 

Private Sub CmdKeluar_Click()

End

End Sub

 

Private Sub CmdProses_Click()

 

TxtHargaPen.Text = Val(TxtHS.Text) * Val(TxtJJual.Text)

Select Case TxtHargaPen.Text

Case Is > 140000000

TxtDis = Val(TxtHargaPen) * 0.15

Case Is > 135000000

TxtDis = Val(TxtHargaPen) * 0.1

Case Is > 130000000

TxtDis = Val(TxtHargaPen) * 0.05

Case Is > 125000000

TxtDis = Val(TxtHargaPen) * 0.02

End Select

TxtTotal = Val(TxtHargaPen) – Val(TxtDis)

 

End Sub

 

Private Sub cmdsave_Click()

Data1.Recordset.AddNew

Data1.Recordset.Update

Data1.Recordset.MoveNext

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 4

4

Private Sub CboKode_Click()

Dim JK, HS, HB As Integer

Select Case CboKode.Text

Case “P205”

JK = “Pentium II 500 Mega Hz”

HS = “1500000”

Case “P308”

JK = “Pentium III 800 Mega Hz”

HS = “2100000”

Case “P310”

JK = “Pentium III 1.0 Giga Hz”

HS = “3500000”

Case “P415”

JK = “Pentium IV 1.5 Giga Hz”

HS = “4000000”

Case “P417”

JK = “Pentium IV 1.7 Giga Hz”

HS = “4200000”

Case “P419”

JK = “Pentium IV 1.9 Giga Hz”

HS = “5500000”

End Select

TxtJCom = JK

TxtHS = HS

TxtJJual.SetFocus

End Sub

 

 

Private Sub cmdadd_Click()

Data1.Recordset.AddNew

Data1.Recordset.Update

Data1.Recordset.MoveLast

End Sub

 

Private Sub cmdbatal_Click()

CboKode.SetFocus

CboKode = “Kode”

TxtJCom = “”

TxtHS = “”

TxtJJual = “”

TxtHargaPen = “”

TxtDis = “”

TxtTotal = “”

End Sub

 

Private Sub cmdhapus_Click()

Data1.Recordset.Delete

End Sub

 

Private Sub CmdKeluar_Click()

End

End Sub

 

Private Sub CmdLagi_Click()

CboKode.SetFocus

CboKode = “Kode”

TxtJCom = “”

TxtHS = “”

TxtJJual = “”

TxtHargaPen = “”

TxtDis = “”

TxtTotal = “”

 

End Sub

 

Private Sub CmdProses_Click()

TxtHargaPen.Text = Val(TxtHS) * Val(TxtJJual)

Select Case TxtHargaPen.Text

Case Is > 30000000

TxtDis = Val(TxtHargaPen) * 0.15

Case Is > 25000000

TxtDis = Val(TxtHargaPen) * 0.1

Case Is > 20000000

TxtDis = Val(TxtHargaPen) * 0.05

Case Is > 15000000

TxtDis = Val(TxtHargaPen) * 0.02

End Select

TxtTotal = Val(TxtHargaPen) – Val(TxtDis)

End Sub

 

Private Sub cmdsave_Click()

Data1.Recordset.AddNew

Data1.Recordset.Update

Data1.Recordset.MoveNext

 

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

 

TUGAS 5

5

Private Sub cmdadd_Click()

Data1.Recordset.AddNew

Data1.Recordset.Update

Data1.Recordset.MoveLast

End Sub

 

Private Sub Cmdbatal_Click()

CboKode.SetFocus

CboKode.Text = “Kode”

TxtJudulBuku.Text = “”

TxtPeng.Text = “”

TxtTahunTer.Text = “”

TxtPenerbit.Text = “”

TxtHarga.Text = “”

End Sub

 

Private Sub CmdEnd_Click()

End

End Sub

 

Private Sub cmdhapus_Click()

Data1.Recordset.Delete

End Sub

 

Private Sub CmdLagi_Click()

CboKode.SetFocus

CboKode.Text = “Kode”

TxtJudulBuku.Text = “”

TxtPeng.Text = “”

TxtTahunTer.Text = “”

TxtPenerbit.Text = “”

TxtHarga.Text = “”

End Sub

 

Private Sub CmdProses_Click()

Dim JudulB, Peng, Pen, Hg As String

TxtTahunTer.Text = “20” & Right(CboKode, 2)

s = Mid(CboKode, 3, 3)

If s = “SIM” Then

JudulB = “Sistem Informasi Manajemen”

Peng = “Yati Nur Oktavia”

Hg = “75900”

 

ElseIf s = “EDP” Then

JudulB = “Elektronik Data Processing”

Peng = “Imam Tarmizi”

Hg = “62000”

 

ElseIf s = “MNJ” Then

JudulB = “Manajemen”

Peng = “Valentina Mariana Adiwianti”

Hg = “42000”

 

ElseIf s = “CDR” Then

JudulB = “Corel Draw”

Peng = “Riyan Suhandi”

Hg = “53000”

 

ElseIf s = “RPL” Then

JudulB = “Rekayasa Perangkat Lunak”

Peng = “Sinta Umpu Singa”

Hg = “83000”

End If

TxtJudulBuku = JudulB

TxtPeng = Peng

TxtHarga = Hg

s = Mid(CboKode, 1, 1)

If s = “A” Then

Pen = “Andi Offset Yogyakarta”

ElseIf s = “I” Then

Pen = “Indah Surabaya”

ElseIf s = “S” Then

Pen = “Salemba Empat”

ElseIf s = “E” Then

Pen = “Elek Media Komputindo”

ElseIf s = “M” Then

Pen = “Maxicom”

End If

TxtPenerbit.Text = Pen

End Sub

 

Private Sub cmdsave_Click()

Data1.Recordset.AddNew

Data1.Recordset.Update

Data1.Recordset.MoveNext

 

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 6

6

Private Sub CmdKeluar_Click()

End

End Sub

Private Sub CmdLagi_Click()

TxtKt.SetFocus

TxtKt.Text = “”

TxtHt.Text = “”

TxtJk.Text = “”

TxtJb.Text = “”

TxtJt.Text = “”

TxtTotalP.Text = “”

End Sub

Private Sub CmdProses_Click()

Dim Jk, Ht, Jb As String

I = Left(TxtKt, 3)

If I = “BIM” Then

Jk = “BIMA”

Ht = “50000”

Jb = “16.00”

 

ElseIf I = “EKO” Then

Jk = “EKONOMI”

Ht = “35000”

Jb = “19.00”

ElseIf I = “MUT” Then

Jk = “MUTIARA”

Ht = “23000”

Jb = “17.00”

ElseIf I = “SEN” Then

Jk = “SENJA”

Ht = “15000”

Jb = “20.00”

End If

TxtJk = Jk

TxtHt = Ht

TxtJb = Jb

TxtJt.SetFocus

End Sub

 

Private Sub Command1_Click()

Data1.Recordset.AddNew

Data1.Recordset.Update

Data1.Recordset.MoveLast

End Sub

 

Private Sub Command2_Click()

Data1.Recordset.AddNew

Data1.Recordset.Update

Data1.Recordset.MoveNext

 

End Sub

 

Private Sub Command3_Click()

TxtKt.SetFocus

TxtKt.Text = “”

TxtHt.Text = “”

TxtJk.Text = “”

TxtJb.Text = “”

TxtJt.Text = “”

TxtTotalP.Text = “”

End Sub

 

Private Sub Command4_Click()

Data1.Recordset.Delete

 

End Sub

 

Private Sub TxtJt_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

TxtTotalP = Val(TxtHt) * Val(TxtJt)

End If

End Sub

 

 

TUGAS 7

 

7.PNG

Private Sub cmdadd_Click()

Data1.Recordset.AddNew

Data1.Recordset.Update

Data1.Recordset.MoveLast

End Sub

 

Private Sub CmdBatal_Click()

TxtKodeBuku.SetFocus

TxtKodeBuku = “”

TxtJudulBuku = “”

TxtPeng = “”

TxtTahunTer = “”

TxtPenerbit = “”

TxtHarga = “”

End Sub

 

Private Sub CmdEnd_Click()

End

End Sub

 

Private Sub cmdhapus_Click()

Data1.Recordset.Delete

End Sub

 

Private Sub CmdLagi_Click()

TxtKodeBuku.SetFocus

TxtKodeBuku = “”

TxtJudulBuku = “”

TxtPeng = “”

TxtTahunTer = “”

TxtPenerbit = “”

TxtHarga = “”

End Sub

 

Private Sub CmdProses_Click()

Dim JudulB, Peng, Pen, Hg As String

TxtTahunTer.Text = “20” & Mid(TxtKodeBuku, 5, 2)

s = Left(TxtKodeBuku, 3)

If s = “SIM” Then

JudulB = “Sistem Informasi Manajemen”

Peng = “Fadiya Ulfa”

Hg = “75900”

 

ElseIf s = “EDP” Then

JudulB = “Elektronik Data Processing”

Peng = “Nurul Agustina”

Hg = “62000”

 

ElseIf s = “MNJ” Then

JudulB = “Manajemen”

Peng = “Rian Hidayat”

Hg = “42000”

 

ElseIf s = “CDR” Then

JudulB = “Corel Draw”

Peng = “Siti Nur Khotimah”

Hg = “53000”

 

ElseIf s = “RPL” Then

JudulB = “Rekayasa Perangkat Lunak”

Peng = “Winda Erlianti”

Hg = “83000”

End If

TxtJudulBuku = JudulB

TxtPeng = Peng

TxtHarga = Hg

 

s = Mid(TxtKodeBuku, 1, 1)

If s = “A” Then

Pen = “Andi Offset Yogyakarta”

ElseIf s = “I” Then

Pen = “Indah Surabaya”

ElseIf s = “S” Then

Pen = “Salemba Empat”

ElseIf s = “E” Then

Pen = “Elek Media Komputindo”

ElseIf s = “M” Then

Pen = “Maxicom”

End If

TxtPenerbit.Text = Pen

End Sub

 

Private Sub cmdsave_Click()

Data1.Recordset.AddNew

Data1.Recordset.Update

Data1.Recordset.MoveNext

End Sub

 

TUGAS 8

8

Private Sub cmdadd_Click()

Data2.Recordset.AddNew

Data2.Recordset.Update

Data2.Recordset.MoveLast

End Sub

 

Private Sub CmdBatal_Click()

TxtNamaKar.SetFocus

TxtNamaKar = “”

TxtNik = “”

TxtGol = “”

TxtKode = “”

TxtStatus = “”

TxtTahun = “”

TxtJabatan = “”

TxtProf = “”

TxtGapok = “”

TxtTunj = “”

TxtTotalG = “”

End Sub

 

Private Sub cmdhapus_Click()

Data2.Recordset.Delete

 

End Sub

 

Private Sub CmdKeluar_Click()

End

End Sub

Private Sub CmdLagi_Click()

TxtNamaKar.SetFocus

TxtNamaKar = “”

TxtNik = “”

TxtGol = “”

TxtKode = “”

TxtStatus = “”

TxtTahun = “”

TxtJabatan = “”

TxtProf = “”

TxtGapok = “”

TxtTunj = “”

TxtTotalG = “”

End Sub

Private Sub CmdProses_Click()

Dim S As String

TxtTahun.Text = Left(TxtNik, 4)

S = Mid(TxtNik, 5, 1)

If S = “A” Then

TxtGol = “A”

TxtJabatan = “Manager”

TxtGapok = “4000000”

TxtTunj = “1025000”

ElseIf S = “B” Then

TxtGol = “B”

TxtJabatan = “Ka. Seksi”

TxtGapok = “3500000”

TxtTunj = “975000”

ElseIf S = “C” Then

TxtGol = “C”

TxtJabatan = “Staff”

TxtGapok = “3000000”

TxtTunj = “925000”

End If

S = Right(TxtNik, 3)

If S = “KEU” Then

TxtProf = “Accounting”

ElseIf S = “ADM” Then

TxtProf = “Administrasi”

ElseIf S = “SDM” Then

TxtProf = “General Affair”

ElseIf S = “EDP” Then

TxtProf = “IT Unit”

ElseIf S = “SPM” Then

TxtProf = “Security”

End If

S = Mid(TxtNik, 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

TxtTotalG = Val(TxtGapok) + Val(TxtTunj)

End Sub

 

Private Sub cmdsave_Click()

Data2.Recordset.AddNew

Data2.Recordset.Update

Data2.Recordset.MoveNext

 

End Sub

 

 

Private Sub TxtNamaKar_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

TxtNik.SetFocus

End If

End Sub

 

 

TUGAS 9

9.PNG

Private Sub cmdadd_Click()

Data1.Recordset.AddNew

Data1.Recordset.Update

Data1.Recordset.MoveLast

Txtkode.SetFocus

End Sub

 

Private Sub cmdcancel_Click()

Data1.Recordset.Delete

Data1.Recordset.MovePrevious

End Sub

 

Private Sub cmdhitung_Click()

txtby = Val(txthb * txtjb)

If txtjb.Text > 5 Then

txtpot = Val(txtby) * 0.02

Else

txtpot = Val(txtby) * 0

End If

txttb = Val(txtby – txtpot)

 

End Sub

 

Private Sub cmdkeluar_Click()

Form2.Show

End Sub

 

Private Sub cmdproses_Click()

Dim KB, HB, NB As Variant

KB = Mid(Txtkode, 5, 2)

Select Case KB

Case “SP”

NB = “SPIDOL”

HB = 9500

Case “BT”

NB = “BUKU TULIS”

HB = 12500

Case “TP”

NB = “TIP EX”

HB = 3000

Case “PG”

NB = “PENGGARIS”

HB = 25000

Case “PT”

NB = “PAPAN TULIS”

HB = 50000

End Select

Txtnb = NB

txthb = HB

txtjb.SetFocus

End Sub

 

Private Sub cmdsave_Click()

Data1.Recordset.AddNew

Data1.Recordset.Update

Data1.Recordset.MoveNext

End Sub

10.PNG

Private Sub Command1_Click()

End

End Sub

 

Private Sub Command2_Click()

Unload Me

End Sub

 

 

Iklan

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout /  Ubah )

Foto Google+

You are commenting using your Google+ account. Logout /  Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout /  Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout /  Ubah )

Connecting to %s