Tugas Mahasiswa Database

1

Private Sub CmbGolongan_Click()
Dim Gapok, Pajak, Tunjangan, Total As Variant
Select Case CmbGolongan.Text
Case “I”
Gapok = 1900000
Tunjangan = 130000
Case “II”
Gapok = 2000000
Tunjangan = 200000
Case “III”
Gapok = 2900000
Tunjangan = 290000
Case “IV”
Gapok = 3000000
Tunjangan = 300000
Case Else
Gapok = 0
Tunjangan = 0
End Select
Total = Gapok + Tunjangan
Pajak = Total * 0.1
TxtGapok.Text = Gapok
TxtTj.Text = Tunjangan
TxtPajak.Text = Pajak
TxtTotal.Text = Total – Pajak
End Sub

Private Sub CmdB_Click()
Data1.Recordset.AddNew
TxtNidn.SetFocus
End Sub

Private Sub CmdBatal_Click()
TxtNidn.SetFocus
TxtNidn = “”
TxtNamaP = “”
CmbGolongan = “Golongan”
TxtGapok = “”
TxtPajak = “”
TxtTj = “”
TxtTotal = “”
End Sub

Private Sub CmdH_Click()
Data1.Recordset.Delete
Data1.Recordset.MoveLast
End Sub

Private Sub CmdKeluar_Click()
Form2.Show
End Sub

Private Sub CmdLagi_Click()
TxtNidn.SetFocus
TxtNidn = “”
TxtNamaP = “”
CmbGolongan = “Golongan”
TxtGapok = “”
TxtPajak = “”
TxtTj = “”
TxtTotal = “”
End Sub

Private Sub CmdS_Click()
Data1.Recordset.AddNew
Data1.Recordset.Update
Data1.Recordset.MoveLast
End Sub

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

Private Sub TxtNidn_keypress(keyascii As Integer)
If keyascii = 13 Then
TxtNamaP.SetFocus
End If
End Sub

Private Sub CmdN_Click()
Form1.Show
Form2.Hide
End Sub

Private Sub CmdY_Click()
End
End Sub

2

Private Sub CmdBaru_Click()
Data1.Recordset.AddNew
TxtNm.SetFocus
End Sub

Private Sub CmdHapus_Click()
Data1.Recordset.Delete
Data1.Recordset.MoveLast
End Sub

Private Sub CmdLagi_Click()
TxtNm.SetFocus
TxtNm = “”
TxtNpm = “”
TxtJr = “”
TxtPStudi = “”
TxtTMasuk = “”
TxtNUrut = “”
End Sub

Private Sub CmdPr_Click()
Dim Ket As String
Ket = Mid(TxtNpm.Text, 3, 1)
If Ket = “1” Then
TxtJr.Text = “Sistem Informasi”
ElseIf Ket = “2” Then
TxtJr.Text = “Manajemen Informatika”
ElseIf Ket = “3” Then
TxtJr.Text = “Tehnik Informatika”
ElseIf Ket = “4” Then
TxtJr.Text = “Manajemen & Komp. Akuntansi”
End If
Ket = Mid(TxtNpm.Text, 4, 2)
If Ket = “00” Then
TxtPStudi.Text = “Strata Satu”
ElseIf Ket = “01” Then
TxtPStudi.Text = “Diploma Tiga”
ElseIf Ket = “02” Then
TxtPStudi.Text = “Diploma Empat”
ElseIf Ket = “03” Then
TxtPStudi.Text = “Diploma Dua”
End If
TxtNUrut.Text = Right(TxtNpm.Text, 3)
TxtTMasuk.Text = “20” & Left(TxtNpm.Text, 2)

End Sub

Private Sub CmdBatal_Click()
TxtNm.SetFocus
TxtNm = “”
TxtNpm = “”
TxtJr = “”
TxtPStudi = “”
TxtTMasuk = “”
TxtNUrut = “”
End Sub

Private Sub CmdEnd_Click()
Form2.Show
End Sub

Private Sub CmdSimpan_Click()
Data1.Recordset.AddNew
Data1.Recordset.Update
Data1.Recordset.MoveLast
End Sub

Private Sub TxtNm_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 Ket As String
Ket = Mid(TxtNpm.Text, 3, 1)
If Ket = “1” Then
TxtJr.Text = “Sistem Informasi”
ElseIf Ket = “2” Then
TxtJr.Text = “Manajemen Informatika”
ElseIf Ket = “3” Then
TxtJr.Text = “Tehnik Informatika”
ElseIf Ket = “4” Then
Txtjur.Text = “Manajemen & Komp. Akuntansi”
End If
Ket = Mid(TxtNpm.Text, 4, 2)
If Ket = “00” Then
TxtPStudi.Text = “Strata Satu”
ElseIf Ket = “01” Then
TxtPStudi.Text = “Diploma Tiga”
ElseIf Ket = “02” Then
TxtPStudi.Text = “Diploma Empat”
ElseIf Ket = “03” Then
TxtPStudi.Text = “Diploma Dua”
End If
TxtNUrut.Text = Right(TxtNpm.Text, 3)
TxtTMasuk.Text = “20” & Left(TxtNpm.Text, 2)
End If
End Sub

Private Sub CmdNo_Click()
Form1.Show
Form2.Hide
End Sub

Private Sub CmdYes_Click()
End
End Sub

3

Private Sub CboKode_Click()
TxtJJual.SetFocus
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 Air”
Merk = “Apple MacBook Air MC965”
Satuan = 12800000
Case “Apple MC966 MacBook Air”
Merk = “Apple MacBook Air MC966”
Satuan = 15800000
End Select
TxtMerk.Text = Merk
TxtHS.Text = Satuan

End Sub

Private Sub CmdEdit_Click()
Data1.Recordset.Edit
End Sub

Private Sub CmdHapus_Click()
Data1.Recordset.Delete
Data1.Recordset.MoveLast
End Sub

Private Sub CmdHL_Click()
CboKode.SetFocus
CboKode = “Kode Laptop”
TxtMerk = “”
TxtHS = “”
TxtTotal = “”
TxtHargaPen = “”
TxtDis = “”
TxtTotal = “”
TxtJJual = “”
End Sub

Private Sub CmdKeluar_Click()
Form2.Show
End Sub

Private Sub CmdProses_Click()
TxtHargaPen = Val(TxtHS) * Val(TxtJJual)

If Val(TxtHargaPen) > 140000000 Then
TxtDis = Val(TxtHargaPen.Text) * 0.15
Else

If Val(TxtHargaPen) > 135000000 Then
TxtDis = Val(TxtHargaPen.Text) * 0.1
Else

If Val(TxtHargaPen) > 130000000 Then
TxtDis = Val(TxtHargaPen.Text) * 0.05
Else

If Val(TxtHargaPen) > 125000000 Then
TxtDis = Val(TxtHargaPen.Text) * 0.02
Else

If Val(TxtHargaPen) <= 125000000 Then
TxtDis = “0”
End If
End If
End If
End If
End If
TxtTotal = Val(TxtHargaPen) – Val(TxtDis)
End Sub

Private Sub CmdSimpan_Click()
Data1.Recordset.AddNew
Data1.Recordset.Update
Data1.Recordset.MoveLast
End Sub

Private Sub Cmdbaru_Click()
Data1.Recordset.AddNew

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 TxtJJual_keypress(keyascii As Integer)
If keyascii = 13 Then
TxtHargaPen = Val(TxtHS) * Val(TxtJJual)

If Val(TxtHargaPen) > 140000000 Then
TxtDis = Val(TxtHargaPen.Text) * 0.15
Else

If Val(TxtHargaPen) > 135000000 Then
TxtDis = Val(TxtHargaPen.Text) * 0.1
Else

If Val(TxtHargaPen) > 130000000 Then
TxtDis = Val(TxtHargaPen.Text) * 0.05
Else

If Val(TxtHargaPen) > 125000000 Then
TxtDis = Val(TxtHargaPen.Text) * 0.02
Else

If Val(TxtHargaPen) <= 125000000 Then
TxtDis = “0”
End If
End If
End If
End If
End If
TxtTotal = Val(TxtHargaPen) – Val(TxtDis)
End If
End Sub

Private Sub CmdNo_Click()
Form1.Show
Form2.Hide
End Sub

Private Sub CmdYes_Click()
End
End Sub

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 CmdB_Click()
Data1.Recordset.AddNew
End Sub

Private Sub CmdH_Click()
Data1.Recordset.Delete
Data1.Recordset.MoveLast
End Sub

Private Sub CmdKeluar_Click()
Form2.Show
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)
If Val(TxtHargaPen) > 30000000 Then
TxtDis = Val(TxtHargaPen.Text) * 0.15
Else
If Val(TxtHargaPen) > 25000000 Then
TxtDis = Val(TxtHargaPen.Text) * 0.1
Else
If Val(TxtHargaPen) > 20000000 Then
TxtDis = Val(TxtHargaPen.Text) * 0.05
Else
If Val(TxtHargaPen) > 15000000 Then
TxtDis = Val(TxtHargaPen.Text) * 0.02

ElseIf Val(TxtHargaPen) <= 15000000 Then
TxtDis = “0”
End If
End If
End If
End If
TxtTotal = Val(TxtHargaPen) – Val(TxtDis)
End Sub

Private Sub CmdS_Click()
Data1.Recordset.AddNew
Data1.Recordset.Update
Data1.Recordset.MoveLast
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 TxtJJual_Keypress(keyascii As Integer)
If keyascii = 13 Then
TxtHargaPen.Text = Val(TxtHS) * Val(TxtJJual)
If Val(TxtHargaPen) > 30000000 Then
TxtDis = Val(TxtHargaPen.Text) * 0.15
Else
If Val(TxtHargaPen) > 25000000 Then
TxtDis = Val(TxtHargaPen.Text) * 0.1
Else
If Val(TxtHargaPen) > 20000000 Then
TxtDis = Val(TxtHargaPen.Text) * 0.05
Else
If Val(TxtHargaPen) > 15000000 Then
TxtDis = Val(TxtHargaPen.Text) * 0.02

ElseIf Val(TxtHargaPen) <= 15000000 Then
TxtDis = “0”
End If
End If
End If
End If
End If
TxtTotal = Val(TxtHargaPen) – Val(TxtDis)
End Sub

Private Sub CmdN_Click()
Form1.Show
Form2.Hide
End Sub

Private Sub CmdY_Click()
End
End Sub

5

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

Private Sub CmdH_Click()
Data1.Recordset.Delete
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()
Form2.Show
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 CmdS_Click()
Data1.Recordset.AddNew
Data1.Recordset.Update
Data1.Recordset.MoveLast
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 CmdNo_Click()
Form1.Show
Form2.Hide
End Sub

Private Sub CmdYes_Click()
End
End Sub

6

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

Private Sub CmdHapus_Click()
Data1.Recordset.MoveLast
Data1.Recordset.Delete
End Sub

Private Sub CmdKeluar_Click()
Form2.Show
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 CmdSimpan_Click()
Data1.Recordset.AddNew
Data1.Recordset.Update
Data1.Recordset.MoveLast
End Sub

Private Sub TxtJt_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
TxtTotalP = Val(TxtHt) * Val(TxtJt)
End If
End Sub

Private Sub CmdNo_Click()
Form1.Show
Form2.Hide
End Sub

Private Sub CmdYes_Click()
End
End Sub

7

Private Sub CmdBatal_Click()
TxtKodeBuku.SetFocus
TxtKodeBuku = “”
TxtJudulBuku = “”
TxtPeng = “”
TxtTahunTer = “”
TxtPenerbit = “”
TxtHarga = “”
End Sub

Private Sub CmdEnd_Click()
Form2.Show
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 Variant
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 = Right(TxtKodeBuku, 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 CmdSimpan_Click()
Data1.Recordset.AddNew
Data1.Recordset.Update
Data1.Recordset.MoveLast
End Sub
Private Sub CmdBaru_Click()
Data1.Recordset.AddNew
End Sub
Private Sub CmdHapus_Click()
Data1.Recordset.Delete
Data1.Recordset.MoveLast
End Sub

Private Sub TxtKodeBuku_keypress(keyascii As Integer)
If keyascii = 13 Then
Dim JudulB, Peng, Pen, Hg As Variant
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 = Right(TxtKodeBuku, 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 If
End Sub

Private Sub CmdNo_Click()
Form1.Show
Form2.Hide
End Sub

Private Sub CmdYes_Click()
End
End Sub

8

Private Sub CmdS_Click()
Data1.Recordset.AddNew
Data1.Recordset.Update
Data1.Recordset.MoveLast
End Sub
Private Sub CmdB_Click()
Data1.Recordset.AddNew
TxtNamaKar.SetFocus
End Sub
Private Sub CmdH_Click()
Data1.Recordset.Delete
Data1.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 CmdKeluar_Click()
Form2.Show
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
Private Sub TxtNik_Keypress(keyascii As Integer)
If keyascii = 13 Then
If keyascii = 13 Then
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 If
End If
End Sub

Private Sub CmdNo_Click()
Form1.Show
Form2.Hide
End Sub

Private Sub CmdYes_Click()
End
End Sub

9
Private Sub CmdPro_Click()
Dim Kode As Variant
Kode = Mid(Txtkode.Text, 5, 2)
If Kode = “SP” Then
TxtNba.Text = “Spidol”
TxtHba.Text = “9500”
ElseIf Kode = “BT” Then
TxtNba.Text = “Buku Tulis”
TxtHba.Text = “12500”
ElseIf Kode = “TP” Then
TxtNba.Text = “TIP EX”
TxtHba.Text = “3000”
ElseIf Kode = “PG” Then
TxtNba.Text = “PENGGARIS”
TxtHba.Text = “25000”
ElseIf Kode = “PT” Then
TxtNba.Text = “PAPAN TULIS”
TxtHba.Text = “50000”
End If
TxtJbe.SetFocus
End Sub

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

Private Sub TxtHit_Click()
TxtBry = Val(TxtHba) * Val(TxtJbe)
If Val(TxtJbe) > 5 Then
TxtPotng = Val(TxtBry.Text) * 0.02
ElseIf Val(TxtJbe.Text) <= 5 Then
TxtPotng = “0”
End If
TxtTba = Val(TxtBry) – Val(TxtPotng)
End Sub

Private Sub TxtKel_Click()
Form2.Show

End Sub

Private Sub TxtSav_Click()
Data1.Recordset.AddNew
Data1.Recordset.Update
End Sub

Private Sub CmdNo_Click()
Form1.Show
Form2.Hide
End Sub

Private Sub CmdYes_Click()
End
End Sub

Iklan

Tugas Mahasiswa VB 7 (6)

Capturenkereta api

Private Sub CmdKeluar_Click()
End
End Sub

Private Sub CmdLagi_Click()
txtkodetiket.SetFocus
txtkodetiket = “”
txthargatiket = “”
txtjeniskereta = “”
txtjamberangkat = “”
txtjumlahtiket = “”
TxtTotal = “”
End Sub

Private Sub CmdProses_Click()
Dim Kode, Harga, Jenis, Berangkat As Variant

Kode = Left(txtkodetiket.Text, 3)
Select Case Kode
Case “BIM”
Harga = 50000
Jenis = “BIMA”
Berangkat = “16.00”
Case “EKO”
Harga = 35000
Jenis = “EKONOMI”
Berangkat = “19.00”
Case “MUT”
Harga = 23000
Jenis = “MUTIARA”
Berangkat = “17.00”
Case “SEN”
Harga = 15000
Jenis = “SENJA”
Berangkat = “20.00”
End Select
txthargatiket = Harga
txtjeniskereta = Jenis
txtjamberangkat = Berangkat
txtjumlahtiket.SetFocus
End Sub

Private Sub TxtJumlahtiket_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
TxtTotal = Val(txthargatiket.Text) * Val(txtjumlahtiket.Text)
End If
End Sub

Tugas Mahasiswa VB 7 (5)

Capture ENTRI DATA PENJUALAN KOMPUTER
Private Sub CboKode_Click()
Dim jenis As String
Dim kode, jk, hs As Variant

kode = CboKode
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 IV  1.7 Giga Hz”
satuan = 4200000
Case “P419”
jenis = “Pentium IV  1.9 Giga Hz”
satuan = 5500000
End Select
txtjeniskomputer = jenis
TxtHargaSatuan = satuan
End Sub

Private Sub CmdKeluar_Click()
End
End Sub

Private Sub CmdLagi_Click()
CboKode.SetFocus

CboKode.Text = “Pilih Kode Komputer”
txtjeniskomputer = “”
TxtHargaSatuan = “”
TxtJumlahJual = “”
TxtHargaJual = “”
TxtDiskon = “”
TxtHargaBayar = “”
End Sub

Private Sub CmdProses_Click()
Dim HargaSatuan, Jumlah, Penjualan, Diskon, Bayar As Variant

Jumlah = Val(TxtJumlahJual)
HargaSatuan = Val(TxtHargaSatuan)
Penjualan = HargaSatuan * Jumlah
TxtHargaJual = Penjualan
Select Case Penjualan
Case Is > 30000000
Diskon = Penjualan * 0.15
Case Is > 25000000
Diskon = Penjualan * 0.1
Case Is > 20000000
Diskon = Penjualan * 0.05
Case Is > 15000000
Diskon = Penjualan * 0.02
Case Is <= 150000000
Diskon = Penjualan * 0
End Select
TxtDiskon = Diskon

Bayar = Penjualan – Diskon
TxtHargaBayar = Bayar
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 Mahasiswa VB 7 (4)

Capture data buku tugas 5
Private Sub CmdBatal_Click()
CboKode.SetFocus
CboKode = “Pilih Kode Buku”
TxtJudulbuku = “”
TxtPengarang = “”
TxtTerbit = “”
TxtPenerbit = “”
TxtHarga = “”
End Sub

Private Sub CmdKeluar_Click()
Unload Me
End Sub

Private Sub CmdLagi_Click()
CboKode.SetFocus
CboKode = “Pilih Kode Buku”
TxtJudulbuku = “”
TxtPengarang = “”
TxtTerbit = “”
TxtPenerbit = “”
TxtHarga = “”
End Sub

Private Sub CmdProses_Click()
Dim Kode, KodeBuku, KodePenerbit, KodeTahun, Tahun, Penerbit, Judul, Pengarang, Harga As Variant

Kode = CboKode
KodeBuku = Mid(Kode, 3, 3)
Select Case KodeBuku
Case “SIM”
Judul = “Sistem Informasi Manajemen”
Pengarang = “Yati Nur Oktavia”
Harga = 75900
Case “EDP”
Judul = “Elektronik Data Processing”
Pengarang = “Imam Tarmizi”
Harga = 62000
Case “MNJ”
Judul = “Manajemen”
Pengarang = “Valentina Mariana Adiwianti”
Harga = 42000
Case “CDR”
Judul = “Corel Draw”
Pengarang = “Riyan Suhandi”
Harga = 53000
Case “RPL”
Judul = “Rekayasa Perangkat Lunak”
Pengarang = “Sinta Umpu Singa”
Harga = 83000
End Select
TxtJudulbuku = Judul
TxtPengarang = Pengarang
TxtHarga = Harga

KodePenerbit = Left(Kode, 1)
Select Case KodePenerbit
Case “A”
Penerbit = “Andi Offset Yogyakarta”
Case “I”
Penerbit = “Indah Surabaya”
Case “S”
Penerbit = “Indah Surabaya”
Case “E”
Penerbit = “Elek Media Komputindo”
Case “M”
Penerbit = “Maxicom”
End Select
TxtPenerbit = Penerbit

KodeTahun = Right(Kode, 2)
Select Case KodeTahun
Case “01”
Tahun = “20” & KodeTahun
Case “02”
Tahun = “20” & KodeTahun
Case “03”
Tahun = “20” & KodeTahun
Case “04”
Tahun = “20” & KodeTahun
Case “05”
Tahun = “20” & KodeTahun
End Select
TxtTerbit = Tahun
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 Mahasiswa VB 7 (3)

Capture DATA BUKU TUGAS 2.PNG
Private Sub CmdBatal_Click()
CboKodebuku.SetFocus
CboKodebuku = “Pilih Kode Buku”
TxtJudulbuku = “”
TxtPengarang = “”
TxttahunTerbit = “”
TxtPenerbit = “”
TxtHarga = “”
End Sub

Private Sub CmdKeluar_Click()
End
End Sub

Private Sub CmdLagi_Click()
CboKodebuku.SetFocus
CboKodebuku = “Pilih Kode Buku”
TxtJudulbuku = “”
TxtPengarang = “”
TxttahunTerbit = “”
TxtPenerbit = “”
TxtHarga = “”
End Sub

Private Sub CmdProses_Click()
Dim Kode, KodeBuku, KodePenerbit, KodeTahun, Tahun, Penerbit, Judul, Pengarang, Harga As Variant

Kode = CboKodebuku
KodeBuku = Left(Kode, 3)
Select Case KodeBuku
Case “SIM”
Judul = “Sistem Informasi Manajemen”
Pengarang = “Fadiya Ulfa”
Harga = 75900
Case “EDP”
Judul = “Elektronik Data Processing”
Pengarang = “Nurul Agustina”
Harga = 62000
Case “MNJ”
Judul = “Manajemen”
Pengarang = “Rian Hidayat”
Harga = 42000
Case “CDR”
Judul = “Corel Draw”
Pengarang = “Siti Nur Khotimah”
Harga = 53000
Case “RPL”
Judul = “Rekayasa Perangkat Lunak”
Pengarang = “Winda Erlianti”
Harga = 83000
End Select
TxtJudulbuku = Judul
TxtPengarang = Pengarang
TxtHarga = Harga

KodePenerbit = Right(Kode, 1)
Select Case KodePenerbit
Case “A”
Penerbit = “Andi Offset Yogyakarta”
Case “I”
Penerbit = “Indah Surabaya”
Case “S”
Penerbit = “Selemba empat”
Case “E”
Penerbit = “Elek Media Komputindo”
Case “M”
Penerbit = “Maxicom”
End Select
TxtPenerbit = Penerbit

KodeTahun = Mid(Kode, 5, 2)
Select Case KodeTahun
Case “09”
Tahun = “20” & KodeTahun
Case “10”
Tahun = “20” & KodeTahun
Case “11”
Tahun = “20” & KodeTahun
Case “12”
Tahun = “20” & KodeTahun
Case “13”
Tahun = “20” & KodeTahun
End Select
TxttahunTerbit = Tahun
End Sub

Private Sub Form_Load()
CboKodebuku.AddItem “SIM-09-A”
CboKodebuku.AddItem “EDP-10-I”
CboKodebuku.AddItem “MNJ-11-S”
CboKodebuku.AddItem “CDR-12-E”
CboKodebuku.AddItem “RPL-13-M”
End Sub

Tugas Mahasiswa VB 7 (2)

Capture NPM

Private Sub cmdbatal_Click()
Txtnama.SetFocus
Txtnama.Text = “”
txtnpm.Text = “”
txtjurusan.Text = “”
txtprogram.Text = “”
txttahun.Text = “”
Txtnomor.Text = “”
End Sub

Private Sub cmdkeluar_Click()
End
End Sub

Private Sub Cmdlagi_Click()
Txtnama.SetFocus
Txtnama.Text = “”
txtnpm.Text = “”
txtjurusan.Text = “”
txtprogram.Text = “”
txttahun.Text = “”
Txtnomor.Text = “”
End Sub

Private Sub cmdproses_Click()
Dim S As String
txttahun.Text = “20” & Left(txtnpm.Text, 2)
S = Mid(txtnpm.Text, 3, 1)
If S = “1” Then
txtjurusan.Text = “Sistem Informasi”
ElseIf S = “2” Then
txtjurusan.Text = “Manajemen Informatika”
ElseIf S = “3” Then
txtjurusan.Text = “Tehnik Informatika”
ElseIf S = “4” Then
txtjurusan.Text = “Manajemen & Komp. Akuntansi”
End If
S = Mid(txtnpm.Text, 4, 2)
If S = “00” Then
txtprogram.Text = “Strata Satu”
ElseIf S = “02” Then
txtprogram.Text = “Diploma Tiga”
ElseIf S = “03” Then
TxtprogramText = “Diploma Empat”
ElseIf S = “04” Then
txtprogram.Text = “Diploma Dua”
End If
Txtnomor.Text = Right(txtnpm.Text, 3)
End Sub
Private Sub form_active()
Txtnama.SetFocus
Txtnama.Text = “”
txtnpm.Text = “”
txtjurusan.Text = “”
txtprogram.Text = “”
txttahun.Text = “”
Txturut.Text = “”
End Sub

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

Tugas Mahasiswa VB 7 (1)

Capture nidn

Public Sub kosong()
txtnidn.SetFocus
txtnidn.Text = “”
txtnama.Text = “”
Cbogolongan.Text = “”
txtgapok.Text = “”
txttunjangan.Text = “”
txtpajak.Text = “”
txttotal.Text = “”
End Sub

Private Sub Cbogolongan_Click()
Dim gapok, pajak, tunjangan, total As Variant
Select Case Cbogolongan.Text
Case “I”
gapok = 2500000
tunjangan = 250000
Case “II”
gapok = 3000000
tunjangan = 300000
Case “III”
gapok = 3500000
tunjangan = 350000
Case “IV”
gapok = 4000000
tunjangan = 400000
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

Private Sub cmdbatal_Click()
kosong
End Sub

Private Sub cmdkeluar_Click()
End
End Sub

Private Sub cmdlagi_Click()
kosong
End Sub

Private Sub txtnidn_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtnama.SetFocus
End If
End Sub

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

Tugas VB Mahasiswa 4

Capture huruf mutu tanpa enter.PNG
Private Sub cbonpm_Click()
Dim nama, jurusan, HM As String

Select Case cbonpm.Text
Case “15100004”
nama = “evi setyorini”
jurusan = “Sistem Informasi”
Case “15100006”
nama = “Oktaviani”
jurusan = “Sistem informasi”
Case “15100012”
nama = “fisuryani”
jurusan = “sistem informasi”
End Select
txtnama.Text = nama
Txtjurusan.Text = jurusan
txtquis.SetFocus
End Sub

Private Sub cmdbatal_Click()

cbonpm.SetFocus
cbonpm.Text = “”
txtnama.Text = “”
Txtjurusan.Text = “”
txtquis.Text = “”
txttugas.Text = “”
txtuts.Text = “”
txtuas.Text = “”
txtnilaiakhir.Text = “”
txthurufmutu.Text = “”
End Sub

Private Sub Cmdkeluar_Click()
End
End Sub

Private Sub Cmdproses_click()
Dim NA As Integer
Dim HM As String
QUIS = Val(txtquis.Text)
TUGAS = Val(txttugas.Text)
UTS = Val(txtuts.Text)
UAS = Val(txtuas.Text)
NA = (QUIS + TUGAS + UTS + UAS) / 4
txtnilaiakhir.Text = NA

Select Case txtnilaiakhir.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
txthurufmutu.Text = HM
End Sub

Private Sub Form_Load()
cbonpm.AddItem “15100004”
cbonpm.AddItem “15100006”
cbonpm.AddItem “15100012”
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 txtuas_keypress(keyascii As Integer)
If keyascii = 13 Then
txtnilaiakhir.SetFocus
End If
End Sub

Private Sub txtuts_KeyPress(keyascii As Integer)
If keyascii = 13 Then
txtuas.SetFocus
End If

End Sub

Tugas VB Mahasiswa 3

Capture huruf mutu
Private Sub cbonpm_Click()
Dim nama, jurusan, HM As String

Select Case cbonpm.Text
Case “15100004”
nama = “evi setyorini”
jurusan = “Sistem Informasi”
Case “15100006”
nama = “Oktaviani”
jurusan = “Sistem informasi”
Case “15100012”
nama = “fisuryani”
jurusan = “sistem informasi”
End Select
txtnama.Text = nama
Txtjurusan.Text = jurusan
txtquis.SetFocus
End Sub

Private Sub cmdbatal_Click()

cbonpm.SetFocus
cbonpm.Text = “”
txtnama.Text = “”
Txtjurusan.Text = “”
txtquis.Text = “”
txttugas.Text = “”
txtuts.Text = “”
txtuas.Text = “”
txtnilaiakhir.Text = “”
txthurufmutu.Text = “”
End Sub

Private Sub Cmdkeluar_Click()
End
End Sub

Private Sub Cmdproses_click()
Dim NA As Integer
Dim HM As String
QUIS = Val(txtquis.Text)
TUGAS = Val(txttugas.Text)
UTS = Val(txtuts.Text)
UAS = Val(txtuas.Text)
NA = (QUIS + TUGAS + UTS + UAS) / 4
txtnilaiakhir.Text = NA

Select Case txtnilaiakhir.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
txthurufmutu.Text = HM
End Sub

Private Sub Form_Load()
cbonpm.AddItem “15100004”
cbonpm.AddItem “15100006”
cbonpm.AddItem “15100012”
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 txtuas_keypress(keyascii As Integer)
If keyascii = 13 Then
Dim NA As Integer
Dim HM As String
QUIS = Val(txtquis.Text)
TUGAS = Val(txttugas.Text)
UTS = Val(txtuts.Text)
UAS = Val(txtuas.Text)
NA = (QUIS + TUGAS + UTS + UAS) / 4
txtnilaiakhir.Text = NA

Select Case txtnilaiakhir.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
txthurufmutu.Text = HM
End If
End Sub

Private Sub txtuts_KeyPress(keyascii As Integer)
If keyascii = 13 Then
txtuas.SetFocus
End If

End Sub

Tugas VB Mahasiswa 2

Capture desi yuhu
Private Sub chkbold_Click()
DESI.FontBold = chkbold.Value
End Sub

Private Sub chkitalic_Click()
DESI.FontItalic = chkitalic.Value
End Sub

Private Sub Cmdok_Click()
DESI.Caption = Text1.Text
End Sub

Private Sub Cmdselesai_Click()
End
End Sub

Private Sub Optblue_Click()
DESI.ForeColor = vbBlue
End Sub

Private Sub optred_Click()
DESI.ForeColor = vbRed
End Sub