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

TUGAS PEMROGRAMAN 1

 

TUGAS 1

1

11

Private Sub CboGolongan_Click()

Dim Golongan, GajiPokok, Tunjangan, Pajak, Total As Variant

Golongan = CboGolongan

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

TxtGajiPokok = GajiPokok

TxtTunjangan = Tunjangan

Pajak = (GajiPokok + Tunjangan) * 0.1

TxtPajak = Pajak

Total = GajiPokok + Tunjangan – Pajak

TxtTotal = Total

End Sub

 

Private Sub CmdBatal_Click()

TxtNidn.SetFocus

TxtNidn.Text = “”

TxtNama.Text = “”

CboGolongan.Text = “Pilih Golongan”

TxtGajiPokok = “”

TxtTunjangan = “”

TxtPajak = “”

TxtTotal = “”

End Sub

 

Private Sub CmdKeluar_Click()

Unload Me

End Sub

 

Private Sub CmdLagi_Click()

TxtNidn.SetFocus

TxtNidn.Text = “”

TxtNama.Text = “”

CboGolongan.Text = “Pilih Golongan”

TxtGajiPokok = “”

TxtTunjangan = “”

TxtPajak = “”

TxtTotal = “”

End Sub

 

Private Sub Form_Load()

CboGolongan.AddItem “I”

CboGolongan.AddItem “II”

CboGolongan.AddItem “III”

CboGolongan.AddItem “IV”

End Sub

 

Private Sub TxtNama_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

CboGolongan.SetFocus

End If

End Sub

 

Private Sub TxtNidn_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

TxtNama.SetFocus

End If

End Sub

 

 

TUGAS 2

2

22

 

Private Sub cmdbatal_Click()

txtnm.SetFocus

txtnm.Text = “”

txtnpm.Text = “”

txtjuru.Text = “”

txtps.Text = “”

txtmasuk.Text = “”

txtno.Text = “”

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 txtnm_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

txtnpm.SetFocus

End If

End Sub

 

 

TUGAS 3

3

33

Private Sub CboKode_Click()

Dim Merk, Harga, Kode As Variant

Kode = Mid(CboKode.Text, 7, 5)

Select Case Kode

Case “MC965”

Merk = “Apple MC965 MacBook Air”

Harga = 12800000

Case “MC966”

Merk = “Apple MC966 MacBook Air

Harga = 15800000

Case “MC968”

Merk = “Apple MC968 MacBook Air”

Harga = 9900000

Case “MC969”

Merk = “Apple MC969 MacBook Air”

Harga = 11900000

Case “MC700”

Merk = “Apple MC700 MacBook Pro”

Harga = 10800000

Case “MC721”

Merk = “Apple MC721 MacBook Pro”

Harga = 15900000

Case “MC723”

Merk = “Apple MC723 MacBook Pro”

Harga = 19300000

Case “MC724”

Merk = “Apple MC724 MacBook Pro”

Harga = 13700000

Case “MC311”

Merk = “Apple MC311 MacBook Pro”

Harga = 24200000

Case “MC313”

Merk = “Apple MC313 MacBook Pro”

Harga = 11900000

Case “MC314”

Merk = “Apple MC314 MacBook Pro”

Harga = 14700000

Case “MC318”

Merk = “Apple MC318 MacBook Pro”

Harga = 17600000

Case “MC322”

Merk = “Apple MC322 MacBook Pro”

Harga = 21300000

End Select

TxtMerk = Merk

TxtHarga = Harga

End Sub

 

Private Sub CmdKeluar_Click()

Unload Me

End Sub

 

Private Sub CmdLagi_Click()

CboKode.SetFocus

CboKode.Text = “Pilih Kode Laptop”

TxtMerk.Text = “”

TxtHarga.Text = “”

TxtJual.Text = “”

TxtHargaJual.Text = “”

TxtDiskon.Text = “”

TxtTotal.Text = “”

End Sub

 

Private Sub CmdProses_Click()

Dim HS, Jual, Jumlah, Diskon, Total As Variant

HS = Val(TxtHarga)

Jual = Val(TxtJual)

Jumlah = HS * Jual

TxtHargaJual = Jumlah

Select Case Jumlah

Case Is > 140000000

Diskon = Jumlah * 0.15

Case Is > 135000000

Diskon = Jumlah * 0.1

Case Is > 130000000

Diskon = Jumlah * 0.05

Case Is > 125000000

Diskon = Jumlah * 0.02

Case Is <= 125000000

Diskon = Jumlah * 0

End Select

TxtDiskon = Diskon

 

Total = Jumlah – Diskon

TxtTotal = Total

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”

End Sub

 

 

TUGAS 4

4

44

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 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 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.PNG

55

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 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 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

66

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 TxtJt_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

TxtTotalP = Val(TxtHt) * Val(TxtJt)

End If

End Sub

 

 

TUGAS 7

7

77.PNG

Private Sub CmdBatal_Click()

TxtKodeBuku.SetFocus

TxtKodeBuku = “”

TxtJudulBuku = “”

TxtPeng = “”

TxtTahunTer = “”

TxtPenerbit = “”

TxtHarga = “”

End Sub

 

Private Sub CmdEnd_Click()

End

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

 

 

TUGAS 8

8

88.PNG

Private Sub CmdBatal_Click()

TxtNamaKar.SetFocus

TxtNamaKar = “”

TxtNik = “”

TxtGol = “”

TxtKode = “”

TxtStatus = “”

TxtTahun = “”

TxtJabatan = “”

TxtProf = “”

TxtGapok = “”

TxtTunj = “”

TxtTotalG = “”

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 TxtNamaKar_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

TxtNik.SetFocus

End If

End Sub

 

 

 

 

TUGAS PEMROGRAMAN 1

TUGAS 1

1

11.PNG

Private Sub Chkbold_Click()

‘membuat teks tebal’

If Chkbold.Value = 1 Then

Lblteks.FontBold = True

Else

Lblteks.FontBold = False

End If

End Sub

Private Sub Chkitalic_Click()

‘membuat teks miring’

If Chkitalic.Value = 1 Then

Lblteks.FontItalic = True

Else

Lblteks.FontItalic = False

End If

End Sub

 

Private Sub Chkstrikethru_Click()

‘membuat teks garis tengah’

If Chkstrikethru.Value = 1 Then

Lblteks.FontStrikethru = True

Else

Lblteks.FontStrikethru = False

End If

End Sub

 

Private Sub Chkunderline_Click()

‘membuat teks bergaris bawah’

If Chkunderline.Value = 1 Then

Lblteks.FontUnderline = True

Else

Lblteks.FontUnderline = False

End If

End Sub

 

Private Sub Cmdexit_Click()

End

End Sub

 

Private Sub Optblue_Click()

‘membuat teks berwarna biru’

Lblteks.ForeColor = vbBlue

End Sub

 

Private Sub Optgreen_Click()

‘membuat teks berwarna hijau’

Lblteks.ForeColor = vbGreen

End Sub

 

Private Sub Optred_Click()

‘membuat teks berwarna merah’

Lblteks.ForeColor = vbRed

End Sub

 

Private Sub Optyellow_Click()

‘membuat teks berwarna kuning’

Lblteks.ForeColor = vbYellow

End Sub

 

TUGAS 2

2.PNG

22.PNG

Private Sub Chkmiring_Click()

If Chkmiring.Value = 1 Then

Label2.FontItalic = True

Else

Label2.FontItalic = False

End If

End Sub

 

Private Sub Chktebal_Click()

If Chktebal.Value = 1 Then

Label2.FontBold = True

Else

Label2.FontBold = False

End If

End Sub

 

Private Sub Cmdok_Click()

Label2.Caption = text1.Text

End Sub

 

Private Sub Cmdselesai_Click()

End

End Sub

 

Private Sub Optblue_Click()

Label2.ForeColor = vbBlue

End Sub

 

Private Sub Optred_Click()

Label2.ForeColor = vbRed

End Sub

 

TUGAS 3

tiga.PNG

33.PNG

Private Sub CboNpm_Click()

Dim nama, jurusan, HM As String

 

Select Case CboNpm.Text

Case “15100003”

nama = “Renita Fitri Andrianti”

jurusan = “Sistem Informasi”

Case “15100007”

nama = “Evi Setyorini”

jurusan = “Sistem Informasi”

Case “15100031”

nama = “Artika Kustriyani”

jurusan = “Sistem Informasi”

Case “15100034”

nama = “Dimas Bima Ananta”

jurusan = “Sistem Informasi”

End Select

TxtNm.Text = nama

TxtJr.Text = jurusan

TxtQs.SetFocus

End Sub

 

Private Sub Cmdbatal_Click()

CboNpm.SetFocus

CboNpm.Text = “”

TxtNm.Text = “”

TxtJr.Text = “”

TxtQs.Text = “”

TxtTgs.Text = “”

TxtUts.Text = “”

TxtUas.Text = “”

TxtNa.Text = “”

LblHM.Text = “”

End Sub

 

Private Sub Cmdkeluar_Click()

Unload Me

End Sub

 

Private Sub Cmdproses_Click()

Dim NA As Integer

Dim HM As String

QUIS = Val(TxtQs.Text)

TUGAS = Val(TxtTgs.Text)

UTS = Val(TxtUts.Text)

UAS = Val(TxtUas.Text)

NA = (QUIS + TUGAS + UTS + UAS) / 4

TxtNa.Text = NA

 

Select Case TxtNa.Text

Case Is > 80

HM = “A”

Case Is > 70

HM = “B”

Case Is > 60

HM = “C”

Case Is > 50

HM = “D”

Case Is < 50

HM = “E”

End Select

Txthm.Text = HM

End Sub

 

Private Sub Form_Load()

CboNpm.AddItem “15100003”

CboNpm.AddItem “15100007”

CboNpm.AddItem “15100031”

CboNpm.AddItem “15100034”

 

End Sub

 

Private Sub TxtQs_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

TxtTgs.SetFocus

End If

End Sub

 

Private Sub TxtTgs_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

TxtUts.SetFocus

End If

End Sub

 

Private Sub TxtUts_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

TxtUas.SetFocus

End If

End Sub

 

TUGAS 4

empat.PNG

44.PNG

Private Sub Cbonpm_click()

Dim nama, jurusan, HM As String

 

Select Case Cbonpm.Text

Case “15100003”

nama = “Renita Fitri Andriyanti”

jurusan = “Sistem Informasi”

Case “15100007”

nama = “Evi Setyorini”

jurusan = “Sistem Informasi”

Case “15100031”

nama = “Artika Kustriyani”

jurusan = “Sistem Informasi”

Case “15100034”

nama = “Dimas Bima Ananta”

jurusan = “Sistem Informasi”

End Select

TxtNM.Text = nama

Txtjr.Text = jurusan

Txtnilaiq.SetFocus

End Sub

 

Private Sub Cmdbatal_Click()

Cbonpm.SetFocus

Cbonpm.Text = “”

txtnama.Text = “”

txtjurusan.Text = “”

txtquis.Text = “”

txttugas.Text = “”

Txtuts.Text = “”

Txtuas.Text = “”

Txtna.Text = “”

Txthm.Text = “”

End Sub

 

End Sub

 

Private Sub Cmdkeluar_Click()

Unload Me

End Sub

 

Private Sub Cmdproses_Click()

Dim NA As Integer

Dim HM As String

QUIS = Val(Txtnilaiq.Text)

TUGAS = Val(Txtnilait.Text)

UTS = Val(Txtuts.Text)

UAS = Val(Txtuas.Text)

NA = (QUIS + TUGAS + UTS + UAS) / 4

Txtnilaia.Text = NA

 

Select Case Txthm.Text

Case Is > 80

HM = “A”

Case Is > 70

HM = “B”

Case Is > 60

HM = “C”

Case Is > 50

HM = “D”

Case Is < 50

HM = “E”

End Select

Txthm.Text = HM

End Sub

 

 

Private Sub Form_Load()

Cbonpm.AddItem “15100003”

Cbonpm.AddItem “15100007”

Cbonpm.AddItem “15100031”

Cbonpm.AddItem “15100034”

 

End Sub

 

Private Sub txtquis_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

txttugas.SetFocus

End If

End Sub

 

Private Sub txttugas_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Txtuts.SetFocus

End If

End Sub

 

 

Private Sub txtnilaiq_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Txtnilait.SetFocus

End If

End Sub

 

Private Sub txtnilait_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Txtuts.SetFocus

End If

End Sub

 

Private Sub Txtuas_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Dim NA As Integer

Dim HM As String

QUIS = Val(Txtnilaiq.Text)

TUGAS = Val(Txtnilait.Text)

UTS = Val(Txtuts.Text)

UAS = Val(Txtuas.Text)

NA = (QUIS + TUGAS + UTS + UAS) / 4

Txtnilaia.Text = NA

 

Select Case Txthm.Text

Case Is > 80

HM = “A”

Case Is > 70

HM = “B”

Case Is > 60

HM = “C”

Case Is > 50

HM = “D”

Case Is < 50

HM = “E”

End Select

Txthm.Text = HM

End If

End Sub

 

Private Sub txtuts_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Txtuas.SetFocus

End If

End Sub

 

TUGAS PEMROGRAMAN 1

PROGRAM 1

TUGAS1

tugas1

Private Sub bilangan1_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

bilangan2.SetFocus

End If

End Sub

 

Private Sub cmdbersih_Click()

bilangan1.SetFocus

bilangan1 = “”

bilangan2 = “”

bilanganhasil = “”

End Sub

 

Private Sub cmdhitung_Click()

bilanganhasil = Val(bilangan1) * Val(bilangan2)

End Sub

 

Private Sub cmdkeluar_Click()

End

End Sub

 

 

TUGAS 2

Capture 2

Private Sub bilangan1_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

bilangan2.SetFocus

End If

End Sub

 

 

Private Sub bilangan2_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

bilanganhasil.SetFocus

bilanganhasil = Val(bilangan1) * Val(bilangan2)

End If

End Sub

 

Private Sub cmdbersih_Click()

bilangan1.SetFocus

bilangan1 = “”

bilangan2 = “”

bilanganhasil = “”

End Sub

 

Private Sub Cmdhitung_Click()

bilanganhasil = Val(bilangan1) * Val(bilangan2)

End Sub

 

Private Sub cmdkeluar_Click()

End

End Sub

 

 

 

PROGRAM 2

TUGAS 3

3

Private Sub cmdbatal_Click()

satu.SetFocus

satu = “”

dua = “”

tiga = “”

empat = “”

lima = “”

enam = “”

tujuh = “”

delapan = “”

sembilan = “”

sepuluh = “”

sebelas = “”

duabelas = “”

 

End Sub

 

Private Sub cmdkeluar_Click()

End

End Sub

 

Private Sub cmdlagi_Click()

satu.SetFocus

satu = “”

dua = “”

tiga = “”

empat = “”

lima = “”

enam = “”

tujuh = “”

delapan = “”

sembilan = “”

sepuluh = “”

sebelas = “”

duabelas = “”

End Sub

 

Private Sub cmdproses_Click()

If sepuluh = “” Or sebelas = “” Then

tiga = Val(satu) + Val(dua)

enam = Val(empat) * Val(lima)

sembilan = Val(tujuh) – Val(delapan)

duabelas = 0

Else

tiga = Val(satu) + Val(dua)

enam = Val(empat) * Val(lima)

sembilan = Val(tujuh) – Val(delapan)

duabelas = Val(sepuluh) / Val(sebelas)

End If

End Sub

 

Private Sub delapan_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

sepuluh.SetFocus

End If

End Sub

 

Private Sub dua_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

empat.SetFocus

End If

End Sub

 

 

Private Sub empat_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

lima.SetFocus

End If

End Sub

 

Private Sub lima_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

tujuh.SetFocus

End If

End Sub

 

Private Sub satu_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

dua.SetFocus

End If

End Sub

 

Private Sub sepuluh_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

sebelas.SetFocus

End If

End Sub

 

Private Sub tujuh_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

delapan.SetFocus

End If

End Sub

 

 

TUGAS 4

Capture 4.PNG

Private Sub cmdbatal_Click()

Penjum1.SetFocus

Penjum1 = “”

penjum2 = “”

penjumhasil = “”

perkal1 = “”

perkal2 = “”

perkalhasil = “”

pengur1 = “”

pengur2 = “”

pengurhasil = “”

pembag1 = “”

pembag2 = “”

pembaghasil = “”

End Sub

 

Private Sub cmdkeluar_Click()

End

End Sub

 

Private Sub cmdlagi_Click()

Penjum1.SetFocus

Penjum1 = “”

penjum2 = “”

penjumhasil = “”

perkal1 = “”

perkal2 = “”

perkalhasil = “”

pengur1 = “”

pengur2 = “”

pengurhasil = “”

pembag1 = “”

pembag2 = “”

pembaghasil = “”

End Sub

 

Private Sub cmdproses_Click()

 

penjumhasil = Val(Penjum1) + Val(penjum2)

perkalhasil = Val(perkal1) * Val(perkal2)

pengurhasil = Val(pengur1) – Val(pengur2)

pembaghasil = Val(pembag1) / Val(pembag2)

 

End Sub

 

Private Sub pembag1_KeyPress(keyAsCII As Integer)

If keyAsCII = 13 Then

pembag2.SetFocus

End If

End Sub

Private Sub pembag2_KeyPress(keyAsCII As Integer)

If keyAsCII = 13 Then

pembaghasil = Val(pembag1) / Val(pembag2)

End If

End Sub

 

Private Sub pengur1_KeyPress(keyAsCII As Integer)

If keyAsCII = 13 Then

pengur2.SetFocus

End If

End Sub

 

Private Sub pengur2_keypress(keyAsCII As Integer)

If keyAsCII = 13 Then

pengurhasil = Val(pengur1) – Val(pengur2)

pembag1.SetFocus

End If

End Sub

 

Private Sub Penjum1_KeyPress(keyAsCII As Integer)

If keyAsCII = 13 Then

penjum2.SetFocus

End If

End Sub

 

 

Private Sub Penjum2_KeyPress(keyAsCII As Integer)

If keyAsCII = 13 Then

penjumhasil = Val(Penjum1) + Val(penjum2)

perkal1.SetFocus

End If

End Sub

 

 

Private Sub perkal1_KeyPress(keyAsCII As Integer)

If keyAsCII = 13 Then

perkal2.SetFocus

End If

End Sub

 

 

Private Sub perkal2_KeyPress(keyAsCII As Integer)

If keyAsCII = 13 Then

perkalhasil = Val(perkal1) * Val(perkal2)

pengur1.SetFocus

End If

End Sub

 

 

 

PROGRAM 3

TUGAS 5

tugas5

Private Sub cmdhitung_Click()

hasildiskon = Val(hasilawal) * 0.1

hasilakhir = Val(hasilawal) – Val(hasildiskon)

End Sub

 

Private Sub cmdquit_Click()

End

End Sub

 

Private Sub cmdulangi_Click()

hasilawal.SetFocus

hasilawal = “”

hasildiskon = “”

hasilakhir = “”

End Sub

 

 

Private Sub hasilawal_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

hasilakhir.SetFocus

hasildiskon = Val(hasilawal) * 0.1

hasilakhir = Val(hargaawal) – Val(hargadiskon)

 

End If

End Sub

 

 

TUGAS 6

tugas gambar 6.PNG

Private Sub cmdhitung_Click()

hasildiskon = Val(hasilawal) * 0.1

hasilakhir = Val(hasilawal) – Val(hasildiskon)

End Sub

 

Private Sub cmdquit_Click()

End

End Sub

 

Private Sub cmdulang_Click()

hasilawal.SetFocus

hasilawal = “”

hasildiskon = “”

hasilakhir = “”

hasilquit = “”

End Sub

 

Private Sub hasilawal_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

hasilakhir.SetFocus

hasildiskon = Val(hasilawal) * 0.1

hasilakhir = Val(hasilawal) – Val(hasildiskon)

End If

End Sub


 

PROGRAM 4

TUGAS 7

TUGAS7.PNG

Private Sub cmdkeluar_Click()

End

End Sub

 

Private Sub cmdproses_Click()

hasilkotor = Val(hasilpokok) + Val(hasiltunjangan) – Val(hasilpotongan)

hasilpajak = Val(hasilkotor) * 0.1

hasilditerima = Val(hasilkotor) – Val(hasilpajak)

End Sub

 

Private Sub cmdulang_Click()

hasilpokok.SetFocus

hasilpokok = “”

hasiltunjangan = “”

hasilpotongan = “”

hasilkotor = “”

hasilpajak = “”

hasilditerima = “”

End Sub

 

Private Sub hasilgaji_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

hasiltunjangan.SetFocus

End If

End Sub

 

Private Sub hasilpotongan_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

End If

End Sub

 

Private Sub hasiltunjangan_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

hasilpotongan.SetFocus

End If

End Sub

 

 

TUGAS 8

tugas8

Private Sub cmdkeluar_Click()

End

End Sub

 

Private Sub cmdproses_Click()

hasilkotor = Val(hasilpokok) + Val(hasiltunjangan) – Val(hasilpotongan)

hasilpajak = Val(hasilkotor) * 0.1

hasilditerima = Val(hasilkotor) – Val(hasilpajak)

End Sub

 

Private Sub cmdulang_Click()

hasilpokok.SetFocus

hasilpokok = “”

hasiltunjangan = “”

hasilpotongan = “”

hasilkotor = “”

hasilpajak = “”

hasilditerima = “”

End Sub

 

 

 

Private Sub hasilgaji_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

hasiltunjangan.SetFocus

End If

End Sub

 

Private Sub hasilpotongan_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

hasilkotor = Val(hasilpokok) + Val(hasiltunjangan) – Val(hasilpotongan)

hasilpajak = Val(hasilkotor) * 0.1

hasilditerima = Val(hasilkotor) – Val(hasilpajak)

End If

End Sub

 

Private Sub hasiltunjangan_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

hasilpotongan.SetFocus

End If

End Sub

 

 

 

Tugas 2 Visual Basic Pemrograman 1

Capture 2

 

Private Sub cmdbatal_Click()

txtnpm.SetFocus

txtnpm = “”

txtnama = “”

txtalamat = “”

txtps = “”

txtjr = “”

txtag = “”

End Sub

 

Private Sub cmdkeluar_Click()

End

End Sub

 

Private Sub cmdlagi_Click()

txtnpm.SetFocus

txtnpm = “”

txtnama = “”

txtalamat = “”

txtps = “”

txtjr = “”

txtag = “”

End Sub

 

Private Sub txtalamat_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

txtps.SetFocus

End If

End Sub

 

 

Private Sub txtjr_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

txtag.SetFocus

End If

End Sub

 

Private Sub txtnama_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

txtalamat.SetFocus

End If

End Sub

 

Private Sub txtnpm_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

txtnama.SetFocus

End If

End Sub

 

 

Private Sub txtps_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

txtjr.SetFocus

End If

End Sub

Tugas 1 Visual Basic Pemrograman 1

Capture 3

 

Private Sub cmdbt_Click()

txtnpm.SetFocus

txtnpm = “”

txtnm = “”

txtalm = “”

End Sub

 

Private Sub cmdkeluar_Click()

End

End Sub

 

Private Sub cmdlg_Click()

txtnpm.SetFocus

txtnpm = “”

txtnm = “”

txtalm = “”

End Sub

 

Private Sub txtnm_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

txtalm.SetFocus

End If

End Sub

 

Private Sub txtnpm_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

txtnm.SetFocus

End If

End Sub

Berkat Husnuddzon.. Penyakit Lumpuh Pun Sembuh..

Alkisah, ada segerombolan perampok yang pekerjaannya merampok kafilah yang lewat. Ketika malam tiba, setelah mendapatkan hasil rampokan, mereka mencari rumah untuk menginap. Tibalah para perampok itu pada sebuah rumah di tepi hutan dan berkata kepada pemilik rumah: “Kami adalah rombongan yang akan berjihad di jalan Allah, kami kemalaman dan bermaksud menginap di rumahmu”.

Pemilik rumah kemudian segera membuka pintu, menyambut mereka dan  melayani mereka dengan baik. Hal itu dilakukan semata untuk memuliakan tamu dan mengharapkan berkah Allah dari tamunya itu.  Pemilik rumah memiliki seorang istri dan anak laki-laki yang lumpuh tidak dapat tegak berdiri.

Setelah menjamu rombongan perampok yang dikiranya tamu kehormatan itu, ia membereskan sisa jamuan dan sisa air kebelakang dan berkata kepada istrinya: “Basuhlah kaki anak kita dengan air ini, siapa tahu dia bisa sembuh dengan keberkahan tamu tamu kita yang berjuang dijalan Allah”.

Si Istri pun melaksanakan perintah suaminya. Besok paginya. kelompok perampok itu keluar menuju suatu tempat dan petang harinya mereka memutuskan untuk kembali kerumah itu. Ketika mereka masuk, mereka heran melihat anak yang kemarin dilihat lumpuh sekarang sudah normal dan bisa berjalan tegak.

Merekapun segera bertanya kepada pemilik rumah: “Apakah itu anakmu yang kemarin dalam keadaan lumpuh?. Ya kemarin aku mengambil sisa air bekas kalian, lalu aku membasuhkannya ke kaki anakku, sehingga atas perkenanNya anakku diberi kesembuhan karena berkah kalian”. jawab pemilik rumah.

Mendengar penjelasan si pemilik rumah, seketika rombongan perampok menangis dan berkata.

“Ketahuilah bahwa kami bukan orang yang sedang berjihad di jalan Allah, tetapi kami ini perampok yang selalu mengganggu para kafilah di wilayah ini”.

Lanjutnya : “Kami menangis, karena walau kami perampok, Allah tetap memberikan keberkahan kepada kami dan dapat menyembuhkan anakmu dengan keikhlasan niatmu menjamu kami dan baiknya sangkamu kepada kami. Oleh karena itu, sekarang kami bertaubat.

Maka bertaubatlah para perampok tersebut. Dan sejak saat itu mereka berjihad di jalan Allah sampai meninggal dunia.

Sumber : KABAR MAKKAH.COM