1
A. Lampiran C1
FORM COPER
2
Lampiran C2
FORM PASSWORD
3
Lampiran C3
FORM MENU UTAMA
4
Lampiran C4
FORM PEMASUKKAN DATA SISWA
5
B. Lampiran C5
FORM PEMASUKKAN PROGRAM KURSUS
6
C. Lampiran C6
FORM PEMBAYARAN
7
D. Lampiran C7
FORM BUKTI PEMBAYARAN
8
E. Lampiran C8
FORM LAPORAN SISWA
9
F. Lampiran C9
FORM LAPORAN PROGRAM
10
G. Lampiran C10
FORM LAPORAN PEMBAYARAN
11
H. Lampiran C11
FORM INFO TOMBOL
12
Lampiran C12
13
3.3.9. Listing Program
I. Listing Program Form Coper Private Sub cmdlogin_Click() Frm_Password.Show End Sub Private Sub Timer1_Timer() Static showcaption As Boolean showcaption = Not showcaption If showcaption Then Label1.ForeColor = vbRed Frm_Coper.Caption = "Agus Creative Production" Else Label1.ForeColor = vbGreen Frm_Coper.Caption = "Aplikasi Pembayaran Kursus" End If End Sub Private Sub Cmdlogout_Click() psn = MsgBox("Yakin Anda Ingin Keluar", 32 + 4, "Informasi") If psn = 6 Then MsgBox " Sampai Ketemu Lagi", 32, "Informasi" Unload Me Else If psn = vbNo Then MsgBox " Kok Enggak Jadi Keluar...Ada Apa Nich", 32, "Ragukan" End If End If End Sub
14
J. Listing Program Form Password Private Sub cmdlogin_Click() cmdlogout.Enabled = True If Not txtuser.Text = "Agus" Then MsgBox "Anda Salah Mengisi User Name", 16, "Enggak Kenal Yach.." txtuser.Text = "" txtuser.SetFocus Else If Not txtpass.Text = "Bsi" Then MsgBox " Maaf Password Anda Salah", 16, "Mau Mencuri Data Yach !!!" txtpass.Text = "" txtpass.SetFocus Else Menu_Utama.Show Frm_Password.Hide Frm_Password.Hide End If End If Frm_Password.Refresh End Sub Private Sub Cmdlogout_Click() Frm_Password.Hide Frm_Coper.Show End Sub Private Sub Form_Activate() txtuser.SetFocus cmdlogout.Enabled = False End Sub
15
Private Sub Timer1_Timer() Static showcaption As Boolean showcaption = Not showcaption If showcaption Then Frame1.ForeColor = vbRed Frm_Password.Caption = "Password" Else Frame1.ForeColor = vbBlue Frm_Password.Caption = "Aplikasi Pembayaran Kursus" End If End Sub Private Sub txtpass_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then cmdlogin.SetFocus End If End Sub Private Sub txtuser_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then txtpass.SetFocus End If End Sub
K. Listing Program Menu Utama Private Sub MnuBukti_Click() Frm_Bukti_Pembayaran.Show Frm_Siswa.Hide Frm_Program.Hide Frm_Pembayaran.Hide Frm_Lap_Siswa.Hide
16
Frm_Lap_Program.Hide Frm_Lap_Pembayaran.Hide Frm_Info_Tombol.Hide Frm_Info_Programmer.Hide FrmLaporan.Hide End Sub Private Sub mnuDataprogram_Click() Frm_Program.Show Frm_Siswa.Hide Frm_Pembayaran.Hide Frm_Bukti_Pembayaran.Hide Frm_Lap_Siswa.Hide Frm_Lap_Program.Hide Frm_Lap_Pembayaran.Hide Frm_Info_Tombol.Hide Frm_Info_Programmer.Hide FrmLaporan.Hide End Sub Private Sub MnuDataSiswa_Click() Frm_Siswa.Show Frm_Program.Hide Frm_Pembayaran.Hide Frm_Bukti_Pembayaran.Hide Frm_Lap_Siswa.Hide Frm_Lap_Program.Hide Frm_Lap_Pembayaran.Hide Frm_Info_Tombol.Hide Frm_Info_Programmer.Hide FrmLaporan.Hide End Sub
17
Private Sub mnuInfoProg_Click() Frm_Info_Programmer.Show Frm_Siswa.Hide Frm_Program.Hide Frm_Pembayaran.Hide Frm_Bukti_Pembayaran.Hide Frm_Lap_Siswa.Hide Frm_Lap_Program.Hide Frm_Lap_Pembayaran.Hide Frm_Info_Tombol.Hide FrmLaporan.Hide End Sub Private Sub mnuInfoTombol_Click() Frm_Info_Tombol.Show Frm_Siswa.Hide Frm_Program.Hide Frm_Pembayaran.Hide Frm_Bukti_Pembayaran.Hide Frm_Lap_Siswa.Hide Frm_Lap_Program.Hide Frm_Lap_Pembayaran.Hide Frm_Info_Programmer.Hide FrmLaporan.Hide End Sub Private Sub mnuKeluar_Click() psn = MsgBox("Yakin Anda Ingin Keluar", 32 + 4, "Informasi") If psn = 6 Then MsgBox " Met Jumpa Dilain kesempatan", 32, "Informasi" Unload Me Else If psn = vbNo Then
18
MsgBox " Kok Enggak Jadi Keluar...Ada Apa Nich", 32, "Ragukan" End If End If End Sub Private Sub mnuLapPembayaran_Click() Frm_Lap_Pembayaran.Show Frm_Bukti_Pembayaran.Hide Frm_Siswa.Hide Frm_Program.Hide Frm_Pembayaran.Hide Frm_Lap_Siswa.Hide Frm_Lap_Program.Hide Frm_Info_Tombol.Hide Frm_Info_Programmer.Hide FrmLaporan.Hide End Sub Private Sub MnuLapProgram_Click() Frm_Lap_Program.Show Frm_Siswa.Hide Frm_Program.Hide Frm_Pembayaran.Hide Frm_Bukti_Pembayaran.Hide Frm_Lap_Siswa.Hide Frm_Lap_Pembayaran.Hide Frm_Info_Tombol.Hide Frm_Info_Programmer.Hide FrmLaporan.Hide End Sub
19
Private Sub MnuLapSiswa_Click() Frm_Lap_Siswa.Show Frm_Siswa.Hide Frm_Program.Hide Frm_Pembayaran.Hide Frm_Bukti_Pembayaran.Hide Frm_Lap_Program.Hide Frm_Lap_Pembayaran.Hide Frm_Info_Tombol.Hide Frm_Info_Programmer.Hide FrmLaporan.Hide End Sub Private Sub mnuPembayaran_Click() Frm_Pembayaran.Show Frm_Siswa.Hide Frm_Program.Hide Frm_Bukti_Pembayaran.Hide Frm_Lap_Siswa.Hide Frm_Lap_Program.Hide Frm_Lap_Pembayaran.Hide Frm_Info_Tombol.Hide Frm_Info_Programmer.Hide FrmLaporan.Hide End Sub
L. Listing Program Form Siswa Dim fl_simpan, fl_edit As Boolean Dim panjang As Byte Dim ket1, nama, A, B As String
20
Dim sw, nom, n As Integer Dim wrkjet As Workspace Dim dbPembayaran_Kursus As Database Dim rssiswa, rsprogram As Recordset Private Sub cmbgel_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then cmdtambah.SetFocus End If End Sub Private Sub cmdcari_Click() On Error Resume Next carikode = InputBox("Ketik NIS", "Pencarian Data") rssiswa.Index = "Nomor_Induk" rssiswa.Seek "=", carikode proses If rssiswa.NoMatch Then MsgBox "Maaf NIS " & carikode & " Belum Terdaftar", 16, "informasi" Else aktif ambil_data Ambil_Program cmdedit.Caption = "&EDIT" cmdtambah.Caption = "&TAMBAH" cmdtambah.Picture = LoadPicture(App.Path & "\icon\tambah.ico") cmdedit.Picture = LoadPicture(App.Path & "\icon\edit.ico") cmdhapus.Enabled = True cmdcetak.Enabled = True cmdkeluar.Enabled = True txtnis.Enabled = False txtnama.Enabled = False txttempat.Enabled = False
21
txttanggal.Enabled = False txtalamat.Enabled = False txtkota.Enabled = False txttlp.Enabled = False cmbkel.Enabled = False cmbagama.Enabled = False txtkode.Enabled = False cmbpen.Enabled = False txtkls.Enabled = False cmbgel.Enabled = False txtprog.Enabled = False End If End Sub Private Sub cmdcetak_Click() layar.Action = 1 End Sub Private Sub cmdedit_Click() On Error Resume Next If cmdedit.Caption = "&EDIT" Then aktif cmdtambah.Caption = "&SIMPAN" cmdedit.Caption = "&BATAL" cmdtambah.Picture = LoadPicture(App.Path & "\icon\simpan.ico") cmdedit.Picture = LoadPicture(App.Path & "\icon\batal.ico") cmdhapus.Enabled = False cmdkeluar.Enabled = False cmdcetak.Enabled = False cmdcari.Enabled = False fl_simpan = False fl_edit = True txtnis.SetFocus
22
txtnis.BackColor = &H80000004 txtnis.Enabled = False txtkode.BackColor = &H80000004 txtkode.Enabled = False txtkls.BackColor = &H80000004 txtkls.Enabled = False txtprog.BackColor = &H80000004 txtprog.Enabled = False If txtnis = "" Then MsgBox "Maaf Enggak Ada Yang Diedit,Cari Dulu", 16, "Informasi" cmdtambah.Caption = "&TAMBAH" cmdedit.Caption = "&EDIT" cmdtambah.Picture = LoadPicture(App.Path & "\icon\Tambah.ico") cmdedit.Picture = LoadPicture(App.Path & "\icon\Edit.ico") cmdhapus.Enabled = True cmdkeluar.Enabled = True cmdcetak.Enabled = True cmdcari.Enabled = True tidak_Aktif End If Else If cmdedit.Caption = "&BATAL" Then cmdedit.Caption = "&EDIT" cmdtambah.Caption = "&TAMBAH" cmdtambah.Picture = LoadPicture(App.Path & "\icon\Tambah.ico") cmdedit.Picture = LoadPicture(App.Path & "\icon\Edit.ico") kosong cmdhapus.Enabled = True cmdkeluar.Enabled = True cmdcetak.Enabled = True cmdcari.Enabled = True
23
tidak_Aktif End If End If End Sub Private Sub Cmdkeluar_Click() psn = MsgBox("Yakin Anda Ingin Keluar", 32 + 4, "Informasi") If psn = 6 Then MsgBox " Balik Lagi Kemenu Utama", 32, "Informasi" dbPembayaran_Kursus.Close Unload Me Else If psn = vbNo Then MsgBox " Kok Enggak Jadi Keluar...Ada Apa Nich", 32, "Ragukan" End If End If End Sub Private Sub cmdhapus_Click() If txtnis = "" Then MsgBox "Tidak Ada Data Yang Akan Dihapus Cari Dahulu Kodenya", 16, "informasi" Else pesan = MsgBox("Betul Akan Dihapus ?", 32 + 4, "delete") If pesan = 6 Then proses rssiswa.Delete rssiswa.MoveFirst Refresh kosong tidak_Aktif MsgBox " Data Terhapus ", 64, "Informasi Hapus Data"
24
End If End If End Sub Private Sub simpan() If txtnis = "" Then MsgBox "NIS Harus Diisi", 16, "informasi" aktif txtnis.SetFocus Else If txtnama = "" Then MsgBox "Namanya Siapa ", 16, "informasi" txtnama.SetFocus Else If txttempat = "" Then MsgBox "Tempat Lahirnya Dimana nich ", 16, "informasi" txttempat.SetFocus Else If txttanggal = "" Then MsgBox "Kapan Lahirnya Yach", 16, "informasi" txttanggal.SetFocus Else If txtalamat = "" Then MsgBox "Punya Alamat Ga sich", 16, "informasi" txtalamat.SetFocus Else If txtkota = "" Then MsgBox "Kotanya mana nich", 16, "informasi" txtkota.SetFocus Else If txttlp = "" Then MsgBox "Nomor Teleponnya Mana nich", 16, "informasi"
25
txttlp.SetFocus Else If cmbkel = "" Then MsgBox "Jenis Kelaminnya Apa nich", 16, "informasi" cmbkel.SetFocus Else If cmbagama = "" Then MsgBox "Punya Kepercayaan nich", 16, "informasi" cmbagama.SetFocus Else If txtkode = "" Then MsgBox "Kodenya Mana nich", 16, "informasi" txtkode.SetFocus Else If cmbpen = "" Then MsgBox "Pendidikannya Mana nich", 16, "informasi" cmbpen.SetFocus Else If txtkls = "" Then MsgBox "Kelas mana nich", 16, "informasi" txtkls.SetFocus Else If cmbgel = "" Then MsgBox "Masuk Gelombang Berapa", 16, "informasi" cmbgel.SetFocus Else rssiswa.Index = "Nomor_Induk" rssiswa.Seek "=", txtnis.Text If Not rssiswa.NoMatch Then MsgBox "Maaf NIS Sudah Terdaftar", 16, "informasi" fl_simpan = True
26
fl_edit = False txtnis = "" txtnis.SetFocus Else proses rssiswa.AddNew rssiswa!nis = txtnis.Text rssiswa!nama = txtnama.Text rssiswa!Kd_Prog = txtkode.Text rssiswa!Tmp_Lahir = txttempat.Text rssiswa!Tgl_Lahir = txttanggal.Text rssiswa!Alamat = txtalamat.Text rssiswa!Kota = txtkota.Text rssiswa!Telp = txttlp.Text rssiswa!Kelamin = cmbkel.Text rssiswa!Agama = cmbagama.Text rssiswa!Pendidikan = cmbpen.Text rssiswa!kelas = txtkls.Text rssiswa!Gel = cmbgel.Text rssiswa.Update fl_simpan = False cmdtambah.Caption = "&TAMBAH" cmdedit.Caption = "&EDIT" cmdtambah.Picture = LoadPicture(App.Path & "\icon\Tambah.ico") cmdedit.Picture = LoadPicture(App.Path & "\icon\Edit.ico") kosong cmdhapus.Enabled = True cmdcetak.Enabled = True cmdcari.Enabled = True cmdkeluar.Enabled = True tidak_Aktif
27
MsgBox " Data Tersimpan", 64, "Informasi Penyimpanan Data" End If End If End If End If End If End If End If End If End If End If End If End If End If End If End Sub Private Sub edit() On Error GoTo salah proses rssiswa.edit rssiswa!nis = txtnis.Text rssiswa!nama = txtnama.Text rssiswa!Kd_Prog = txtkode.Text rssiswa!Tmp_Lahir = txttempat.Text rssiswa!Tgl_Lahir = txttanggal.Text rssiswa!Alamat = txtalamat.Text rssiswa!Kota = txtkota.Text rssiswa!Telp = txttlp.Text rssiswa!Kelamin = cmbkel.Text rssiswa!Agama = cmbagama.Text rssiswa!Pendidikan = cmbpen.Text
28
rssiswa!kelas = txtkls.Text rssiswa!Gel = cmbgel.Text rssiswa.Update tidak_Aktif cmdtambah.Caption = "&TAMBAH" cmdedit.Caption = "&EDIT" cmdtambah.Picture = LoadPicture(App.Path & "\icon\Tambah.ico") cmdedit.Picture = LoadPicture(App.Path & "\icon\Edit.ico") kosong MsgBox "Data Telah Diperbaruhi", 64, "Informasi Edit Data" salah: fl_edit = False cmdtambah.Caption = "&TAMBAH" cmdedit.Caption = "&EDIT" cmdtambah.Picture = LoadPicture(App.Path & "\icon\Tambah.ico") cmdedit.Picture = LoadPicture(App.Path & "\icon\edit.ico") cmdhapus.Enabled = True cmdcetak.Enabled = True cmdcari.Enabled = True cmdkeluar.Enabled = True End Sub Private Sub cmdtambah_Click() If cmdtambah.Caption = "&TAMBAH" Then cmdtambah.Caption = "&SIMPAN" cmdedit.Caption = "&BATAL" cmdtambah.Picture = LoadPicture(App.Path & "\icon\simpan.ico") cmdedit.Picture = LoadPicture(App.Path & "\icon\batal.ico") fl_simpan = True fl_edit = False cmdhapus.Enabled = False cmdkeluar.Enabled = False
29
cmdcetak.Enabled = False cmdcari.Enabled = False aktif kosong txtnis.SetFocus Else If cmdtambah.Caption = "&SIMPAN" Then If fl_simpan = True Then simpan End If If fl_edit = True Then edit fl_edit = False End If End If End If End Sub Private Sub kosong() txtnis.Text = "" txtkode.Text = "" txtnama.Text = "" txttempat.Text = "" txttanggal.Text = "" txtalamat.Text = "" txtkota.Text = "" txttlp.Text = "" cmbkel.Text = "" cmbagama.Text = "" cmbpen.Text = ""
30
txtkls.Text = "" cmbgel.Text = "" txtprog.Text = "" End Sub Private Sub Form_Activate() kosong txtnis.MaxLength = 7 txtkode.MaxLength = 2 txtnama.MaxLength = 25 txttempat.MaxLength = 20 txttanggal.MaxLength = 8 txtalamat.MaxLength = 30 txtkota.MaxLength = 15 txttlp.MaxLength = 12 txtkls.MaxLength = 2 tidak_Aktif End Sub Private Sub Form_Initialize() cmbkel.AddItem "LAKI-LAKI" cmbkel.AddItem "PEREMPUAN" cmbkel.Text = "" cmbagama.AddItem "ISLAM" cmbagama.AddItem "KRISTEN PROTESTAN" cmbagama.AddItem "KRISTEN KATOLIK" cmbagama.AddItem "HINDU" cmbagama.AddItem "BUDHA" cmbagama.AddItem "KEPERCAYAAN" cmbagama.Text = "" cmbpen.AddItem "SD" cmbpen.AddItem "SLTP" cmbpen.AddItem "SLTA"
31
cmbpen.AddItem "DIPLOMA" cmbpen.AddItem "SARJANA" cmbpen.Text = "" cmbgel.AddItem "01" cmbgel.AddItem "02" cmbgel.AddItem "03" cmbgel.AddItem "04" cmbgel.Text = "" End Sub Private Sub Form_Load() Set wrkjet = CreateWorkspace("", "Admin", "", dbUseJet) Set dbPembayaran_Kursus = OpenDatabase(App.Path & “\Data\Pembayaran_Kursus.mdb") Set rssiswa = dbPembayaran_Kursus.OpenRecordset("Tabel_Siswa") Set rsprogram = dbPembayaran_Kursus.OpenRecordset("Tabel_Program") rssiswa.Index = "Nomor_Induk" fl_simpan = False tl_edit = False n=1 ket1 = "" Timer1.Enabled = True End Sub Private Sub tidak_Aktif() txtnis.BackColor = &H80000004 txtkode.BackColor = &H80000004 txtnama.BackColor = &H80000004 txttempat.BackColor = &H80000004 txttanggal.BackColor = &H80000004 txtalamat.BackColor = &H80000004 txtkota.BackColor = &H80000004
32
txttlp.BackColor = &H80000004 cmbkel.BackColor = &H80000004 cmbagama.BackColor = &H80000004 cmbpen.BackColor = &H80000004 txtkls.BackColor = &H80000004 cmbgel.BackColor = &H80000004 txtprog.BackColor = &H80000004 txtnis.Enabled = False txtkode.Enabled = False txtnama.Enabled = False txttempat.Enabled = False txttanggal.Enabled = False txtalamat.Enabled = False txtkota.Enabled = False txttlp.Enabled = False cmbkel.Enabled = False cmbagama.Enabled = False cmbpen.Enabled = False txtkls.Enabled = False cmbgel.Enabled = False txtprog.Enabled = False End Sub Private Sub aktif() txtnis.BackColor = &H80000005 txtkode.BackColor = &H80000005 txtnama.BackColor = &H80000005 txttempat.BackColor = &H80000005 txttanggal.BackColor = &H80000005 txtalamat.BackColor = &H80000005 txtkota.BackColor = &H80000005 txttlp.BackColor = &H80000005
33
cmbkel.BackColor = &H80000005 cmbagama.BackColor = &H80000005 cmbpen.BackColor = &H80000005 txtkls.BackColor = &H80000005 cmbgel.BackColor = &H80000005 txtprog.BackColor = &H80000005 txtnis.Enabled = True txtkode.Enabled = True txtnama.Enabled = True txttempat.Enabled = True txttanggal.Enabled = True txtalamat.Enabled = True txtkota.Enabled = True txttlp.Enabled = True cmbkel.Enabled = True cmbagama.Enabled = True cmbpen.Enabled = True txtkls.Enabled = True cmbgel.Enabled = True txtprog.Enabled = True End Sub Private Sub ambil_data() txtnis.Text = rssiswa!nis txtkode.Text = rssiswa!Kd_Prog txtnama.Text = rssiswa!nama txttempat.Text = rssiswa!Tmp_Lahir txttanggal.Text = rssiswa!Tgl_Lahir txtalamat.Text = rssiswa!Alamat txtkota.Text = rssiswa!Kota txttlp.Text = rssiswa!Telp cmbkel.Text = rssiswa!Kelamin
34
cmbagama.Text = rssiswa!Agama cmbpen.Text = rssiswa!Pendidikan txtkls.Text = rssiswa!kelas cmbgel.Text = rssiswa!Gel End Sub Private Sub Ambil_Program() rsprogram.Index = "Kode" rsprogram.Seek "=", txtkode.Text If rsprogram.NoMatch Then MsgBox " Kode Program " & txtkode.Text & " Belon Tercatat", 16, Pesan Salah" txtkode.Text = "" txtnis.SetFocus Else txtprog.Text = rsprogram!Program End If End Sub Private Sub Timer1_Timer() nama = " Pemasukan Data Siswa ket1 = ket1 & " " & Mid(nama, n, 1) Label13.Caption = ket1 If n = Len(nama) Then ket1 = "" n=1 Else n=n+1 End If Label13.ForeColor = vbBlue End Sub
"
35
Private Sub Timer2_Timer() Static showcaption As Boolean showcaption = Not showcaption If showcaption Then Label13.ForeColor = vbRed Frm_Siswa.Caption = "Form Siswa" Else Label13.ForeColor = vbBlack Frm_Siswa.Caption = "Aplikasi Pembayaran Kursus" End If End Sub Private Sub txtkls_KeyPress(KeyAscii As Integer) KeyAscii = Asc(UCase(Chr(KeyAscii))) If KeyAscii = 13 Then cmbgel.SetFocus End If End Sub Private Sub txtnis_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then txtnama.SetFocus Else If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = vbKeyBack) Then MsgBox "Hanya Boleh Diisi Dengan Angka", 16, "Informasi" KeyAscii = 0 End If End If End Sub
36
Private Sub txtnama_KeyPress(KeyAscii As Integer) KeyAscii = Asc(UCase(Chr(KeyAscii))) If KeyAscii = 13 Then txttempat.SetFocus End If End Sub Private Sub txtnis_LostFocus() On Error Resume Next panjang = Len(txtnis.Text) If txtnis = "" Then tidak_Aktif Exit Sub Else If panjang < 7 Then MsgBox "Nis Harus 7 Digit", 16, "Informasi" fl_edit = False txtnis = "" txtnis.SetFocus Else If panjang > 7 Then MsgBox "Nis Harus 7 Digit", 16, "Informasi" fl_edit = False txtnis = "" txtnis.SetFocus Else A = Mid(txtnis, 3, 2) If A = A Then txtkode = A Ambil_Program End If
37
End If End If End If End Sub Private Sub txttempat_KeyPress(KeyAscii As Integer) KeyAscii = Asc(UCase(Chr(KeyAscii))) If KeyAscii = 13 Then txttanggal.SetFocus Else End If End Sub Private Sub txttanggal_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then txtalamat.SetFocus End If End Sub Private Sub txtalamat_KeyPress(KeyAscii As Integer) KeyAscii = Asc(UCase(Chr(KeyAscii))) If KeyAscii = 13 Then txtkota.SetFocus End If End Sub Private Sub txtkota_KeyPress(KeyAscii As Integer) KeyAscii = Asc(UCase(Chr(KeyAscii))) If KeyAscii = 13 Then txttlp.SetFocus End If End Sub
38
Private Sub txttlp_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then cmbkel.SetFocus End If End Sub Private Sub cmbkel_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then cmbagama.SetFocus End If End Sub Private Sub cmbagama_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then cmbpen.SetFocus End If End Sub Private Sub txtkode_keypress(KeyAscii As Integer) If KeyAscii = 13 Then txtkls.SetFocus Else If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = vbKeyBack) Then MsgBox "hanya boleh diisi dengan angka ", 16, "informasi" KeyAscii = 0 End If End If End Sub
39
Private Sub cmbpen_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then txtkls.SetFocus End If End Sub Private Sub proses() Dim putar As Integer ProgressBar1.Min = 0 ProgressBar1.Max = 1000 ProgressBar1.Visible = True ProgressBar1.Value = ProgressBar1.Min For putar = ProgressBar1.Min To ProgressBar1.Max ProgressBar1.Value = putar Next putar ProgressBar1.Value = ProgressBar1.Min End Sub
M. Listing Program Form Program Kursus Dim fl_simpan, fl_edit As Boolean Dim panjang As Byte Dim ket1, nama, A As String Dim sw, nom, n As Integer Dim dbPembayaran_Kursus As Database Dim rsprogram As Recordset Private Sub cmdcari_Click() On Error Resume Next cariode = InputBox("Ketik Kode Sepeda") rsprogram.Index = "Kode" rsprogram.Seek "=", cariode
40
proses If rsprogram.NoMatch Then MsgBox "Maaf Kode " & cariode & " Belum Terdaftar", 16, "informasi" Else aktif ambil_data cmdedit.Caption = "&EDIT" cmdtambah.Caption = "&TAMBAH" cmdtambah.Picture = LoadPicture(App.Path & "\icon\tambah.ico") cmdedit.Picture = LoadPicture(App.Path & "\icon\edit.ico") cmdhapus.Enabled = True cmdcetak.Enabled = True cmdkeluar.Enabled = True txtkd_prog.Enabled = False txtprog.Enabled = False txtuang.Enabled = False End If End Sub Private Sub cmdcetak_Click() nom = 1 sw = 1 FrmLaporan.Show Cetaklayar End Sub Private Sub cmdedit_Click() On Error Resume Next If cmdedit.Caption = "&EDIT" Then aktif cmdtambah.Caption = "&SIMPAN" cmdedit.Caption = "&BATAL" cmdtambah.Picture = LoadPicture(App.Path & "\icon\simpan.ico")
41
cmdedit.Picture = LoadPicture(App.Path & "\icon\batal.ico") cmdhapus.Enabled = False cmdkeluar.Enabled = False cmdcetak.Enabled = False cmdcari.Enabled = False fl_simpan = False fl_edit = True txtuang.SetFocus txtkd_prog.Enabled = False txtkd_prog.BackColor = &H80000004 If txtkd_prog = "" Then MsgBox "Maaf Enggak Ada Yang Diedit, Cari Dulu", 16, "Informasi" cmdtambah.Caption = "&TAMBAH" cmdedit.Caption = "&EDIT" cmdtambah.Picture = LoadPicture(App.Path & "\icon\Tambah.ico") cmdedit.Picture = LoadPicture(App.Path & "\icon\Edit.ico") cmdhapus.Enabled = True cmdkeluar.Enabled = True cmdcetak.Enabled = True cmdcari.Enabled = True tidak_Aktif End If Else If cmdedit.Caption = "&BATAL" Then cmdedit.Caption = "&EDIT" cmdtambah.Caption = "&TAMBAH" cmdtambah.Picture = LoadPicture(App.Path & "\icon\tambah.ico") cmdedit.Picture = LoadPicture(App.Path & "\icon\edit.ico") kosong cmdhapus.Enabled = True cmdkeluar.Enabled = True
42
cmdcetak.Enabled = True cmdcari.Enabled = True tidak_Aktif End If End If End Sub Private Sub cmdhapus_Click() On Error Resume Next If txtkd_prog = "" Then MsgBox "Tidak Ada Data Yang Akan Dihapus, Cari Dahulu Kodenya", 16, "informasi" Else pesan = MsgBox("Betul Akan Dihapus ?", 32 + 4, "delete") If pesan = 6 Then proses rsprogram.Delete rsprogram.MoveFirst Refresh kosong tidak_Aktif MsgBox " Penghapusan Data Sukses ", 64, "Informasi Hapus Data" End If End If End Sub Private Sub Cmdkeluar_Click() psn = MsgBox("Yakin Anda Ingin Keluar", 32 + 4, "Informasi") If psn = 6 Then MsgBox " Balik Lagi Kemenu Utama", 32, "Informasi" dbPembayaran_Kursus.Close Unload Me Else
43
If psn = vbNo Then MsgBox " Kok Enggak Jadi Keluar...Ada Apa Nich", 32, "Ragukan" End If End If End Sub Private Sub cmdtambah_Click() If cmdtambah.Caption = "&TAMBAH" Then cmdtambah.Caption = "&SIMPAN" cmdedit.Caption = "&BATAL" cmdtambah.Picture = LoadPicture(App.Path & "\icon\simpan.ico") cmdedit.Picture = LoadPicture(App.Path & "\icon\batal.ico") fl_simpan = True fl_edit = False cmdhapus.Enabled = False cmdcetak.Enabled = False cmdcari.Enabled = False aktif kosong txtkd_prog.SetFocus ElseIf cmdtambah.Caption = "&SIMPAN" Then If fl_simpan = True Then simpan End If If fl_edit = True Then edit fl_edit = False End If End If End Sub
44
Private Sub simpan() If txtkd_prog = "" Then MsgBox "Isi Donk Kodenya", 16, "Informasi" aktif txtkd_prog.SetFocus Else If txtprog = "" Then MsgBox "Nama Programnya Apa..Tong", 16, "Informasi" txtprog.SetFocus Else If txtuang = "" Then MsgBox "Berapa Duit Nich Program", 16, "Informasi" txtuang.SetFocus Else rsprogram.Index = "Kode" rsprogram.Seek "=", txtkd_prog.Text If Not rsprogram.NoMatch Then MsgBox "Maaf Kode Program sudah terdaftar", 16, "informasi" fl_simpan = True fl_edit = False txtkd_prog = "" txtkd_prog.SetFocus Else proses rsprogram.AddNew rsprogram!Kd_Prog = txtkd_prog.Text rsprogram!Program = txtprog.Text rsprogram!uang_Kursus = txtuang.Text rsprogram.Update fl_simpan = False cmdtambah.Caption = "&TAMBAH"
45
cmdedit.Caption = "&EDIT" cmdtambah.Picture = LoadPicture(App.Path & "\icon\tambah.ico") cmdedit.Picture = LoadPicture(App.Path & "\icon\edit.ico") kosong cmdhapus.Enabled = True cmdcetak.Enabled = True cmdcari.Enabled = True tidak_Aktif MsgBox " Data Tersimpan", 64, "Informasi Penyimpanan Data" End If End If End If End If End Sub Private Sub Form_Activate() txtkd_prog.MaxLength = 2 txtprog.MaxLength = 28 txtuang.MaxLength = 7 tidak_Aktif kosong End Sub Private Sub Form_Load() Set dbPembayaran_Kursus = OpenDatabase(App.Path & "\data\Pembayaran_Kursus.mdb") Set rsprogram = dbPembayaran_Kursus.OpenRecordset("tabel_program", dbOpenTable) rsprogram.Index = "Kode" fl_simpan = False fl_edit = False n=1
46
ket1 = "" Timer1.Enabled = True End Sub Private Sub kosong() txtkd_prog.Text = "" txtprog.Text = "" txtuang.Text = "" End Sub Private Sub aktif() txtkd_prog.Enabled = True txtprog.Enabled = True txtuang.Enabled = True txtkd_prog.BackColor = &H80000005 txtprog.BackColor = &H80000005 txtuang.BackColor = &H80000005 End Sub Private Sub ambil_data() On Error Resume Next txtkd_prog.Text = rsprogram!Kd_Prog txtprog.Text = rsprogram!Program txtuang.Text = rsprogram!uang_Kursus End Sub Private Sub tidak_Aktif() txtkd_prog.Enabled = False txtprog.Enabled = False txtuang.Enabled = False txtkd_prog.BackColor = &H80000004 txtprog.BackColor = &H80000004 txtuang.BackColor = &H80000004 End Sub
47
Private Sub Timer1_Timer() nama = "
Form Program Kursus "
ket1 = ket1 & " " & Mid(nama, n, 1) Label4.Caption = ket1 If n = Len(nama) Then ket1 = "" n=1 Else n=n+1 End If Label4.ForeColor = vbBlue End Sub Private Sub Timer2_Timer() Static showcaption As Boolean showcaption = Not showcaption If showcaption Then Label4.ForeColor = vbRed Frm_Program.Caption = "Form Data Program Kursus" Else Label4.ForeColor = vbBlack Frm_Program.Caption = "Aplikasi Pembayaran Kursus" End If End Sub Private Sub txtkd_prog_keypress(KeyAscii As Integer) If KeyAscii = 13 Then txtprog.SetFocus Else If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = vbKeyBack) Then MsgBox "Hanya boleh diisi dengan angka", 16, "informasi" KeyAscii = 0
48
End If End If End Sub Private Sub edit() On Error GoTo salah proses rsprogram.edit rsprogram!Kd_Prog = txtkd_prog.Text rsprogram!Program = txtprog.Text rsprogram!uang_Kursus = txtuang.Text rsprogram.Update kosong tidak_Aktif MsgBox "Data Telah Diperbaruhi", 64, "Informasi Edit Data" cmdtambah.Caption = "&TAMBAH" cmdedit.Caption = "&EDIT" cmdtambah.Picture = LoadPicture(App.Path & "\icon\Tambah.ico") cmdedit.Picture = LoadPicture(App.Path & "\icon\Edit.ico") salah: fl_edit = False cmdtambah.Caption = "&TAMBAH" cmdedit.Caption = "&EDIT" cmdtambah.Picture = LoadPicture(App.Path & "\icon\Tambah.ico") cmdedit.Picture = LoadPicture(App.Path & "\icon\Edit.ico") cmdhapus.Enabled = True cmdkeluar.Enabled = True cmdcetak.Enabled = True cmdcari.Enabled = True End Sub
49
Sub Cetaklayar() On Error Resume Next rsprogram.MoveFirst Do While Not rsprogram.EOF If sw = 1 Then FrmLaporan.FontBold = True FrmLaporan.FontSize = 14 FrmLaporan.Print FrmLaporan.Print "
DATA PR0GRAM KURSUS
FrmLaporan.Print "
_______________________
" "
FrmLaporan.FontBold = False FrmLaporan.FontSize = 10 FrmLaporan.Print FrmLaporan.Print " ***********************************" FrmLaporan.FontBold = True FrmLaporan.Print Tab(8); "No"; FrmLaporan.Print Tab(18); "Kode Program"; FrmLaporan.Print Tab(35); "Program Kursus"; FrmLaporan.Print Tab(61); "Uang Kursus"; FrmLaporan.FontBold = False FrmLaporan.Print FrmLaporan.Print " ***********************************" sw = 0 End If FrmLaporan.Print Tab(10); Format(nom, "###"); FrmLaporan.Print Tab(25); rsprogram!Kd_Prog; FrmLaporan.Print Tab(40); rsprogram!Program; FrmLaporan.Print Tab(70); rsprogram!uang_Kursus; FrmLaporan.Print rsprogram.MoveNext nom = nom + 1
50
Loop FrmLaporan.Print "**********************************" End Sub Private Sub txtkd_prog_LostFocus() panjang = Len(txtkd_prog.Text) If txtkd_prog = "" Then tidak_Aktif Exit Sub Else If panjang < 2 Then MsgBox "Kode Harus Dua Digit", 16, "kode kurang" fl_edit = False txtkd_prog = "" txtkd_prog.SetFocus Else If panjang > 2 Then MsgBox "Kode Harus Dua Digit", 16, "Kode lebih" txtkd_prog = "" txtkd_prog.SetFocus End If End If End If End Sub Private Sub proses() Dim putar As Integer ProgressBar1.Min = 0 ProgressBar1.Max = 1000 ProgressBar1.Visible = True ProgressBar1.Value = ProgressBar1.Min For putar = ProgressBar1.Min To ProgressBar1.Max ProgressBar1.Value = putar
51
Next putar ProgressBar1.Value = ProgressBar1.Min End Sub Private Sub txtprog_KeyPress(KeyAscii As Integer) KeyAscii = Asc(UCase(Chr(KeyAscii))) If KeyAscii = 13 Then txtuang.SetFocus End If End Sub Private Sub txtuang_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then cmdtambah.SetFocus Else If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = vbKeyBack) Then MsgBox "Hanya boleh diisi dengan angka", 16, "informasi" KeyAscii = 0 End If End If End Sub
N. Listing Program Form Pembayaran Dim fl_simpan, fl_edit As Boolean Dim panjang As Byte Dim ket1, nama, A, B As String Dim sw, nom, n As Integer Dim wrkjet As Workspace Dim dbPembayaran_Kursus As Database Dim rsbayar, rsprogram, rssiswa As Recordset
52
Private Sub cmdcari_Click() On Error Resume Next cariode = InputBox("Ketik Nomor Bukti") rsbayar.Index = "Nomor" rsbayar.Seek "=", cariode proses If rsbayar.NoMatch Then MsgBox "Maaf No Bukti " & cariode & " Belum Terdaftar", 16, "informasi" Else aktif ambil_data ambil_Siswa Ambil_Program cmdedit.Caption = "&EDIT" cmdtambah.Caption = "&TAMBAH" cmdtambah.Picture = LoadPicture(App.Path & "\icon\tambah.ico") cmdedit.Picture = LoadPicture(App.Path & "\icon\edit.ico") cmdhapus.Enabled = True cmdcetak.Enabled = True cmdkeluar.Enabled = True txtnobuk.Enabled = False txtnis.Enabled = False txttglbayar.Enabled = False txtjumlah.Enabled = False txtket.Enabled = False txtnama.Enabled = False txtprog.Enabled = False txtkls.Enabled = False txtgel.Enabled = False End If End Sub
53
Private Sub cmdcetak_Click() nom = 1 sw = 1 FrmLaporan.Show Cetaklayar End Sub Private Sub cmdedit_Click() On Error Resume Next If cmdedit.Caption = "&EDIT" Then aktif cmdtambah.Caption = "&SIMPAN" cmdedit.Caption = "&BATAL" cmdtambah.Picture = LoadPicture(App.Path & "\icon\simpan.ico") cmdedit.Picture = LoadPicture(App.Path & "\icon\batal.ico") cmdhapus.Enabled = False cmdkeluar.Enabled = False cmdcetak.Enabled = False cmdcari.Enabled = False fl_simpan = False fl_edit = True txtnobuk.SetFocus txtgel.Enabled = False txtnama.Enabled = False txtkls.Enabled = False txtprog.Enabled = False txtjumlah.Enabled = False txtket.Enabled = False txtnobuk.Enabled = False txtnama.BackColor = &H80000004 txtprog.BackColor = &H80000004 txtgel.BackColor = &H80000004
54
txtkls.BackColor = &H80000004 txtjumlah.BackColor = &H80000004 txtket.BackColor = &H80000004 txtnobuk.BackColor = &H80000004 If txtnobuk = "" Then MsgBox "Maaf Enggak Ada Yang Diedit, Cari Dulu", 16, "Informasi" cmdtambah.Caption = "&TAMBAH" cmdedit.Caption = "&EDIT" cmdtambah.Picture = LoadPicture(App.Path & "\icon\tambah.ico") cmdedit.Picture = LoadPicture(App.Path & "\icon\edit.ico") cmdhapus.Enabled = True cmdkeluar.Enabled = True cmdcetak.Enabled = True cmdcari.Enabled = True tidak_Aktif End If Else If cmdedit.Caption = "&BATAL" Then cmdedit.Caption = "&EDIT" cmdtambah.Caption = "&TAMBAH" cmdtambah.Picture = LoadPicture(App.Path & "\icon\tambah.ico") cmdedit.Picture = LoadPicture(App.Path & "\icon\edit.ico") kosong cmdhapus.Enabled = True cmdkeluar.Enabled = True cmdcetak.Enabled = True cmdcari.Enabled = True tidak_Aktif End If End If End Sub
55
Private Sub cmdhapus_Click() If txtnobuk = "" Then pesan = MsgBox("Tidak Ada Data Yang Akan Dihapus, Cari Dahulu Kodenya", 16, "informasi") Else MsgBox "Betul Akan Dihapus ?", 32 + 4, "delete" If pesan = 6 Then proses rsbayar.Delete rsbayar.MoveFirst Refresh kosong tidak_Aktif MsgBox " Penghapusan Data Sukses ", 64, "Informasi Hapus Data" End If End If End Sub Private Sub Cmdkeluar_Click() psn = MsgBox("Yakin Anda Ingin Keluar", 32 + 4, "Informasi") If psn = 6 Then MsgBox " Balik Lagi Kemenu Utama", 32, "Informasi" dbPembayaran_Kursus.Close Unload Me Else If psn = vbNo Then MsgBox " Kok Enggak Jadi Keluar...Ada Apa Nich", 32, "Ragukan" End If End If End Sub
56
Private Sub cmdtambah_Click() If cmdtambah.Caption = "&TAMBAH" Then cmdtambah.Caption = "&SIMPAN" cmdedit.Caption = "&BATAL" cmdtambah.Picture = LoadPicture(App.Path & "\icon\simpan.ico") cmdedit.Picture = LoadPicture(App.Path & "\icon\batal.ico") fl_simpan = True fl_edit = False cmdhapus.Enabled = False cmdkeluar.Enabled = True cmdcetak.Enabled = False cmdcari.Enabled = False aktif kosong txtnobuk.SetFocus txttglbayar.Text = Date Else If cmdtambah.Caption = "&SIMPAN" Then If fl_simpan = True Then simpan End If If fl_edit = True Then edit fl_edit = False End If End If End If End Sub
57
Private Sub simpan() If txtnobuk = "" Then MsgBox "Isi Donk nobuknya", 16, "Informasi" aktif txtnobuk.SetFocus Else If txtnis = "" Then MsgBox "Berapa NISnya", 16, "Informasi" txtnis.SetFocus Else If txttglbayar = "" Then MsgBox "Kapan Bayarnya", 16, "Informasi" txttglbayar.SetFocus Else If txtket = "" Then MsgBox "Punya Penjelasan Khan", 16, "Informasi" txtket.SetFocus Else rsbayar.Index = "Nomor" rsbayar.Seek "=", txtnobuk.Text If Not rsbayar.NoMatch Then MsgBox "Maaf No Bukti sudah terdaftar", 16, "informasi" fl_simpan = True fl_edit = False txtnobuk = "" txtnobuk.SetFocus Else proses rsbayar.AddNew rsbayar!No_Bukti = txtnobuk.Text rsbayar!nis = txtnis.Text
58
rsbayar!Tgl_Bayar = txttglbayar.Text rsbayar!Keterangan = txtket.Text rsbayar.Update fl_simpan = False cmdtambah.Caption = "&TAMBAH" cmdedit.Caption = "&EDIT" cmdtambah.Picture = LoadPicture(App.Path & "\icon\tambah.ico") cmdedit.Picture = LoadPicture(App.Path & "\icon\edit.ico") kosong cmdhapus.Enabled = True cmdcetak.Enabled = True cmdcari.Enabled = True tidak_Aktif MsgBox " Data Tersimpan", 64, "Informasi Penyimpanan Data" End If End If End If End If End If End Sub Private Sub Ambil_Program() A = Mid(txtnis, 3, 2) rsprogram.Index = "Kode" rsprogram.Seek "=", A txtprog.Text = rsprogram!Program txtjumlah.Text = rsprogram!uang_Kursus End Sub Private Sub ambil_Siswa() On Error Resume Next rssiswa.Index = "Nomor_Induk" rssiswa.Seek "=", txtnis.Text
59
txtnama.Text = rssiswa!nama txtkls.Text = rssiswa!kelas txtgel.Text = rssiswa!Gel End Sub Private Sub Form_Activate() txtnobuk.MaxLength = 4 txtnis.MaxLength = 7 txttglbayar.MaxLength = 8 txtjumlah.MaxLength = 11 txtket.MaxLength = 5 tidak_Aktif kosong End Sub Private Sub Form_Load() Set wrkjet = CreateWorkspace("", "Admin", "", dbUseJet) Set dbPembayaran_Kursus = OpenDatabase(App.Path & “\data\pembayaran_Kursus.mdb") Set rsbayar = dbPembayaran_Kursus.OpenRecordset("tabel_pembayaran", dbOpenTable) Set rssiswa = dbPembayaran_Kursus.OpenRecordset("tabel_Siswa", dbOpenTable) Set rsprogram = dbPembayaran_Kursus.OpenRecordset("tabel_Program", dbOpenTable) rsbayar.Index = "Nomor" rssiswa.Index = "Nomor_Induk" rsprogram.Index = "Kode" fl_simpan = False fl_edit = False n=1
60
ket1 = "" Timer1.Enabled = True End Sub Private Sub kosong() txtnobuk.Text = "" txtnis.Text = "" txttglbayar.Text = "" txtjumlah.Text = "" txtket.Text = "" txtnama.Text = "" txtprog.Text = "" txtkls.Text = "" txtgel.Text = "" End Sub Private Sub aktif() txtnobuk.Enabled = True txtnis.Enabled = True txttglbayar.Enabled = True txtjumlah.Enabled = True txtket.Enabled = True txtnama.Enabled = True txtprog.Enabled = True txtkls.Enabled = True txtgel.Enabled = True txtnobuk.BackColor = &H80000005 txtnis.BackColor = &H80000005 txttglbayar.BackColor = &H80000005 txtjumlah.BackColor = &H80000005 txtnama.BackColor = &H80000005 txtprog.BackColor = &H80000005
61
txtkls.BackColor = &H80000005 txtgel.BackColor = &H80000005 txtket.BackColor = &H80000005 End Sub Private Sub ambil_data() On Error Resume Next txtnobuk.Text = rsbayar!No_Bukti txtnis.Text = rsbayar!nis txttglbayar.Text = rsbayar!Tgl_Bayar txtjumlah.Text = rsbayar!Jml_Bayar txtket.Text = rsbayar!Keterangan End Sub Private Sub tidak_Aktif() txtnobuk.Enabled = False txtnis.Enabled = False txttglbayar.Enabled = False txtjumlah.Enabled = False txtket.Enabled = False txtnama.Enabled = True txtprog.Enabled = True txtkls.Enabled = True txtgel.Enabled = True txtnobuk.BackColor = &H80000004 txtnis.BackColor = &H80000004 txttglbayar.BackColor = &H80000004 txtjumlah.BackColor = &H80000004 txtket.BackColor = &H80000004 txtnama.BackColor = &H80000004 txtprog.BackColor = &H80000004
62
txtkls.BackColor = &H80000004 txtgel.BackColor = &H80000004 End Sub Private Sub Timer1_Timer() nama = " Formulir Pembayaran
"
ket1 = ket1 & " " & Mid(nama, n, 1) Label5.Caption = ket1 If n = Len(nama) Then ket1 = "" n=1 Else n=n+1 End If Label5.ForeColor = vbBlue End Sub Private Sub Timer2_Timer() Static showcaption As Boolean showcaption = Not showcaption If showcaption Then Label5.ForeColor = vbRed Frm_Pembayaran.Caption = "Form Pembayaran Kursus" Else Label5.ForeColor = vbBlack Frm_Pembayaran.Caption = "Aplikasi Pembayaran Kursus" End If End Sub Private Sub txtket_KeyPress(KeyAscii As Integer) KeyAscii = Asc(UCase(Chr(KeyAscii))) If KeyAscii = 13 Then cmdtambah.SetFocus
63
End If End Sub Private Sub txtnis_LostFocus() B = Mid(txtnis, 3, 2) rssiswa.Seek "=", txtnis.Text rsprogram.Seek "=", B If Not rssiswa.NoMatch And Not rsprogram.NoMatch Then txtnama.Text = rssiswa!nama txtgel.Text = rssiswa!Gel txtkls.Text = rssiswa!kelas txtprog.Text = rsprogram!Program txtjumlah.Text = rsprogram!uang_Kursus Else If txtnis = "" Then Exit Sub Else MsgBox " Kode Belum Terdaftar", 64, "Informasi" txtnis.Text = "" txtnis.SetFocus End If End If End Sub Private Sub txtnobuk_keypress(KeyAscii As Integer) If KeyAscii = 13 Then txtnis.SetFocus Else If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = vbKeyBack) Then MsgBox "Hanya boleh diisi dengan angka", 16, "informasi" KeyAscii = 0
64
End If End If End Sub Private Sub txtnis_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then txtket.SetFocus End If End Sub Private Sub edit() On Error GoTo salah proses rsbayar.edit rsbayar!No_Bukti = txtnobuk.Text rsbayar!nis = txtnis.Text rsbayar!Tgl_Bayar = txttglbayar.Text rsbayar!Keterangan = txtket.Text rsbayar.Update kosong tidak_Aktif MsgBox "Data Telah Diperbaruhi", 64, "Informasi Edit Data" cmdtambah.Caption = "&TAMBAH" cmdedit.Caption = "&EDIT" cmdtambah.Picture = LoadPicture(App.Path & "\icon\tambah.ico") cmdedit.Picture = LoadPicture(App.Path & "\icon\edit.ico") salah: fl_edit = False cmdtambah.Caption = "&TAMBAH" cmdedit.Caption = "&EDIT" cmdhapus.Enabled = True cmdkeluar.Enabled = True
65
cmdcetak.Enabled = True cmdcari.Enabled = True End Sub Sub Cetaklayar() On Error Resume Next rsbayar.MoveFirst Do While Not rsbayar.EOF If sw = 1 Then FrmLaporan.FontBold = True FrmLaporan.FontSize = 14 FrmLaporan.Print FrmLaporan.Print " LAPORAN PEMBAYARAN KURSUS " FrmLaporan.Print " ________________________________
"
FrmLaporan.FontBold = False FrmLaporan.FontSize = 10 FrmLaporan.Print FrmLaporan.Print " *********************************" FrmLaporan.FontBold = True FrmLaporan.Print Tab(5); "No"; FrmLaporan.Print Tab(17); "No Bukti"; FrmLaporan.Print Tab(29); "Nomor Induk"; FrmLaporan.Print Tab(47); "Tanggal Bayar"; FrmLaporan.Print Tab(65); "Keterangan"; FrmLaporan.FontBold = False FrmLaporan.Print FrmLaporan.Print " **********************************" sw = 0 End If FrmLaporan.Print Tab(7); Format(nom, "###"); FrmLaporan.Print Tab(20); rsbayar!No_Bukti; FrmLaporan.Print Tab(33); rsbayar!nis;
66
FrmLaporan.Print Tab(54); rsbayar!Tgl_Bayar; FrmLaporan.Print Tab(75); rsbayar!Keterangan; FrmLaporan.Print rsbayar.MoveNext nom = nom + 1 Loop FrmLaporan.Print " ***********************************" End Sub Private Sub txtnobuk_LostFocus() panjang = Len(txtnobuk.Text) If txtnobuk = "" Then tidak_Aktif Exit Sub Else If panjang < 4 Then MsgBox "No Bukti Harus Empat Digit", 16, "kode kurang" fl_edit = False txtnobuk = "" txtnobuk.SetFocus Else If panjang > 4 Then MsgBox "No Bukti Harus Empat Digit", 16, "Kode lebih" txtnobuk = "" txtnobuk.SetFocus End If End If End If End Sub
67
Private Sub proses() Dim putar As Integer ProgressBar1.Min = 0 ProgressBar1.Max = 1000 ProgressBar1.Visible = True ProgressBar1.Value = ProgressBar1.Min For putar = ProgressBar1.Min To ProgressBar1.Max ProgressBar1.Value = putar Next putar ProgressBar1.Value = ProgressBar1.Min End Sub Private Sub txttglbayar_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then txtket.SetFocus End If End Sub
O. Listing Program Form Bukti Pembayaran Dim ket1, nama As String Dim n As Integer Private Sub Cmdkeluar_Click() psn = MsgBox("Yakin Anda Ingin Keluar", 32 + 4, "Informasi") If psn = 6 Then MsgBox " Met Jumpa Dilain kesempatan", 32, "Informasi" Unload Me Else If psn = vbNo Then MsgBox " Kok Enggak Jadi Keluar...Ada Apa Nich", 32, "Ragukan"
68
End If End If End Sub Private Sub cmdlapor_Click() If Len(txtnilai) Then Bayar.SelectionFormula = "{Tabel_Pembayaran.No_Bukti}= '" & txtnilai & "'" End If Bayar.Action = 1 txtnilai.Text = "" End Sub Private Sub Form_Load() n=1 ket1 = "" Timer1.Enabled = True End Sub Private Sub Timer1_Timer() nama = "
Bukti Pembayaran
ket1 = ket1 & " " & Mid(nama, n, 1) Label1.Caption = ket1 If n = Len(nama) Then ket1 = "" n=1 Else n=n+1 End If Label1.ForeColor = vbBlue End Sub
"
69
Private Sub Timer2_Timer() Static showcaption As Boolean showcaption = Not showcaption If showcaption Then Label1.ForeColor = vbRed Frm_Bukti_Pembayaran.Caption = "Bukti Pembayaran" Else Label1.ForeColor = vbBlack Frm_Bukti_Pembayaran.Caption = "Aplikasi Pembayaran Kursus" End If End Sub Private Sub txtnilai_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then cmdlapor.SetFocus End If End Sub
P. Listing Program Form Laporan Siswa Dim ket1, nama As String Dim n As Integer Private Sub Cmdlaporan_Click() lblStatus.Caption = "Mengatur pilihan report. " & _ "tunggu sebentar..." Select Case lstTipeReport.ListIndex Case 0 If Len(txtnilai) Then Siswa.SelectionFormula = "{Tabel_Siswa.NIS}= '" & txtnilai & "'" Else Siswa.SelectionFormula = "{Tabel_Siswa.NIS} = {Tabel_Siswa.NIS}"
70
End If Siswa.SortFields(0) = "+{Tabel_Siswa.NIS}" Case 1 If Len(txtnilai) Then Siswa.SelectionFormula = "{Tabel_Siswa.Nama}= '" & txtnilai & "'" Else Siswa.SelectionFormula = "{Tabel_Siswa.Nama} = {Tabel_Siswa.Nama}" End If Siswa.SortFields(0) = "+{Tabel_Siswa.Nama}" End Select Siswa.Action = 1 txtnilai.Text = "" lblStatus.Caption = "Masukkan pilihan yang baru dan cetak atau keluar!" End Sub Private Sub Cmdkeluar_Click() psn = MsgBox("Yakin Anda Ingin Keluar", 32 + 4, "Informasi") If psn = 6 Then MsgBox " Met Jumpa Dilain kesempatan", 32, "Informasi" Unload Me Else If psn = vbNo Then MsgBox " Kok Enggak Jadi Keluar...Ada Apa Nich", 32, "Ragukan" End If End If End Sub Private Sub Form_Load() n=1 ket1 = "" Timer1.Enabled = True Me.Move Screen.Width - 1.1 * Me.Width, _
71
Screen.Height - 1.25 * Me.Height With lstTipeReport .Clear .AddItem "Nomor Induk Siswa" .AddItem "Nama Siswa" End With lblStatus.Caption = "Pilih tipe laporan." End Sub Private Sub lstTipeReport_CLick() If Len(lstTipeReport.Text) Then Select Case lstTipeReport.ListIndex Case 0 lblInstruksi.Caption = "&Masukkan NIS: " lblStatus.Caption = "Masukkan NIS atau " & _ "kosongkan jika memilih semua." Case 1 lblInstruksi.Caption = "&Masukkan Nama Siswa:" lblStatus.Caption = "Masukkan Nama Siswa atau " & _ "kosongkan jika memilih semua." End Select txtnilai.Text = "" lblInstruksi.Visible = True txtnilai.Visible = True txtnilai.SetFocus Else txtnilai.Text = "" lblInstruksi.Visible = False txtnilai.Visible = False End If End Sub
72
Private Sub Timer1_Timer() nama = " Form Laporan Siswa
"
ket1 = ket1 & " " & Mid(nama, n, 1) Label2.Caption = ket1 If n = Len(nama) Then ket1 = "" n=1 Else n=n+1 End If Label2.ForeColor = vbBlue End Sub Private Sub Timer2_Timer() Static showcaption As Boolean showcaption = Not showcaption If showcaption Then Label2.ForeColor = vbRed Frm_Lap_Siswa.Caption = "Laporan Data Siswa" Else Label2.ForeColor = vbBlack Frm_Lap_Siswa.Caption = "Aplikasi Pembayaran Kursus" End If End Sub Private Sub txtnilai_KeyPress(KeyAscii As Integer) KeyAscii = Asc(UCase(Chr(KeyAscii))) If KeyAscii = 13 Then cmdlaporan.SetFocus End If End Sub
73
Q. Listing Program Form Laporan Program Kursus Dim ket1, nama As String Dim n As Integer Private Sub Cmdlaporan_Click() lblStatus.Caption = "Mengatur pilihan report. " & _ "tunggu sebentar..." Select Case lstTipeReport.ListIndex Case 0 If Len(txtnilai) Then Program.SelectionFormula = "{Tabel_Program.Kd_Prog}= '" & txtnilai & "'" Else Program.SelectionFormula = "{Tabel_Program.Kd_Prog} = {Tabel_Program.Kd_Prog}" End If Program.SortFields(0) = "+{Tabel_Program.Kd_Prog}" Case 1 If Len(txtnilai) Then Program.SelectionFormula = "{Tabel_Program.Program}= '" & txtnilai & "'" Else Program.SelectionFormula = "{Tabel_Program.Program} = {Tabel_Program.Program}" End If Program.SortFields(0) = "+{Tabel_Program.Program}" End Select Program.Action = 1 txtnilai.Text = "" lblStatus.Caption = "Masukkan pilihan yang baru dan cetak atau keluar!" End Sub
74
Private Sub Cmdkeluar_Click() psn = MsgBox("Yakin Anda Ingin Keluar", 32 + 4, "Informasi") If psn = 6 Then MsgBox " Met Jumpa Dilain kesempatan", 32, "Informasi" Unload Me Else If psn = vbNo Then MsgBox " Kok Enggak Jadi Keluar...Ada Apa Nich", 32, "Ragukan" End If End If End Sub Private Sub Form_Load() n=1 ket1 = "" Timer1.Enabled = True Me.Move Screen.Width - 1.1 * Me.Width, _ Screen.Height - 1.25 * Me.Height With lstTipeReport .Clear .AddItem "Kode Program" .AddItem "Nama Program" End With lblStatus.Caption = "Pilih tipe laporan." End Sub Private Sub lstTipeReport_CLick() If Len(lstTipeReport.Text) Then Select Case lstTipeReport.ListIndex Case 0 lblInstruksi.Caption = "&Masukkan Kode Program: " lblStatus.Caption = "Masukkan Kode Program atau " & _ "kosongkan jika memilih semua."
75
Case 1 lblInstruksi.Caption = "&Masukkan Program:" lblStatus.Caption = "Masukkan Program atau " & _ "kosongkan jika memilih semua." End Select txtnilai.Text = "" lblInstruksi.Visible = True txtnilai.Visible = True txtnilai.SetFocus Else txtnilai.Text = "" lblInstruksi.Visible = False txtnilai.Visible = False End If End Sub Private Sub Timer1_Timer() nama = " Laporan Data Program
"
ket1 = ket1 & " " & Mid(nama, n, 1) Label2.Caption = ket1 If n = Len(nama) Then ket1 = "" n=1 Else n=n+1 End If Label2.ForeColor = vbBlue End Sub Private Sub Timer2_Timer() Static showcaption As Boolean showcaption = Not showcaption If showcaption Then
76
Label2.ForeColor = vbRed Frm_Lap_Program.Caption = "Laporan Data Program" Else Label2.ForeColor = vbBlack Frm_Lap_Program.Caption = "Aplikasi Pembayaran Kursus" End If End Sub Private Sub txtnilai_KeyPress(KeyAscii As Integer) KeyAscii = Asc(UCase(Chr(KeyAscii))) If KeyAscii = 13 Then Cmdlaporan.SetFocus End If End Sub
R. Listing Program Form Laporan Data Pembayaran Dim ket1, nama As String Dim n As Integer Private Sub Cmdlaporan_Click() lblStatus.Caption = "Mengatur pilihan report. " & _ "tunggu sebentar..." Select Case lstTipeReport.ListIndex Case 0 If Len(txtnilai) Then bayar.SelectionFormula = "{Tabel_pembayaran.No_Bukti}= '" & txtnilai & "'" Else bayar.SelectionFormula = "{Tabel_pembayaran.No_bukti = {Tabel_pembayaran.No_Bukti}" End If bayar.SortFields(0) = "+{Tabel_pembayaran.No_Bukti}"
77
Case 1 If Len(txtnilai) Then bayar.SelectionFormula = "{Tabel_pembayaran.Nis}= '" & txtnilai & "'" Else bayar.SelectionFormula = "{Tabel_pembayaran.Nis} = {Tabel_pembayaran.Nis}" End If bayar.SortFields(0) = "+{Tabel_pembayaran.Nis}" End Select bayar.Action = 1 txtnilai.Text = "" lblStatus.Caption = "Masukkan pilihan yang baru dan cetak atau keluar!" End Sub Private Sub Cmdkeluar_Click() psn = MsgBox("Yakin Anda Ingin Keluar", 32 + 4, "Informasi") If psn = 6 Then MsgBox " Met Jumpa Di Menu Utama", 32, "Informasi" Unload Me Else If psn = vbNo Then MsgBox " Kok Enggak Jadi Keluar...Ada Apa Nich", 32, "Ragukan" End If End If End Sub Private Sub Form_Load() n=1 ket1 = "" Timer1.Enabled = True Me.Move Screen.Width - 1.1 * Me.Width, _ Screen.Height - 1.25 * Me.Height With lstTipeReport
78
.Clear .AddItem "Nomor Bukti" .AddItem "Nomor Induk Siswa" End With lblStatus.Caption = "Pilih tipe laporan." End Sub Private Sub lstTipeReport_CLick() If Len(lstTipeReport.Text) Then Select Case lstTipeReport.ListIndex Case 0 lblInstruksi.Caption = "&Masukkan NIS: " lblStatus.Caption = "Masukkan NIS atau " & _ "kosongkan jika memilih semua." Case 1 lblInstruksi.Caption = "&Masukkan No Bukti:" lblStatus.Caption = "Masukkan No Bukti atau " & _ "kosongkan jika memilih semua." End Select txtnilai.Text = "" lblInstruksi.Visible = True txtnilai.Visible = True txtnilai.SetFocus Else txtnilai.Text = "" lblInstruksi.Visible = False txtnilai.Visible = False End If End Sub
79
Private Sub Timer1_Timer() nama = " Laporan Data Pembayaran
"
ket1 = ket1 & " " & Mid(nama, n, 1) Label2.Caption = ket1 If n = Len(nama) Then ket1 = "" n=1 Else n=n+1 End If Label2.ForeColor = vbGreen End Sub Private Sub Timer2_Timer() Static showcaption As Boolean showcaption = Not showcaption If showcaption Then Label2.ForeColor = vbRed Frm_Lap_Pembayaran.Caption = "Laporan Data Pembayaran" Else Label2.ForeColor = vbBlack Frm_Lap_Pembayaran.Caption = "Aplikasi Pembayaran Kursus" End If End Sub Private Sub txtnilai_KeyPress(KeyAscii As Integer) KeyAscii = Asc(UCase(Chr(KeyAscii))) If KeyAscii = 13 Then Cmdlaporan.SetFocus End If End Sub
80
S. Listing Program Form Info Tombol Private Sub cmdbatal_Click() MsgBox " Untuk Membatalkan Penyimpanan Data", 64, "Info Tombol" End Sub Private Sub cmdcari_Click() MsgBox " Untuk Mencari atau Menampilkan Data", 64, "Info Tombol" End Sub Private Sub cmdcetak_Click() MsgBox " Untuk Menampilkan Data Ke Layar", 64, "Info Tombol" End Sub Private Sub cmdedit_Click() MsgBox " Untuk Merubah Data", 64, "Info Tombol" End Sub Private Sub cmdhapus_Click() MsgBox " Untuk Menghapus Data", 64, "Info Tombol" End Sub Private Sub Cmdkeluar_Click() MsgBox " Untuk Keluar Dari Form Aktif", 64, "Info Tombol" End Sub Private Sub cmdkeluar1_Click() psn = MsgBox("Yakin Anda Ingin Keluar", 32 + 4, "Informasi") If psn = 6 Then MsgBox " Balik Lagi Kemenu Utama", 32, "Informasi" Unload Me Else If psn = vbNo Then MsgBox " Kok Enggak Jadi Keluar...Ada Apa Nich", 32, "Ragukan"
81
End If End If End Sub Private Sub cmdlapor_Click() MsgBox " Untuk Mencetak Data", 64, "Info Tombol" End Sub Private Sub cmdok_Click() MsgBox " Untuk Keluar Dari Info Programmer Data", 64, "Info Tombol" End Sub Private Sub cmdsimpan_Click() MsgBox " Untuk Menyimpan Data", 64, "Info Tombol" End Sub Private Sub cmdtambah_Click() MsgBox " Untuk Menambah Data", 64, "Info Tombol" End Sub Private Sub Timer1_Timer() Static showcaption As Boolean showcaption = Not showcaption If showcaption Then Label1.ForeColor = vbRed Frm_Info_Tombol.Caption = "Biodata Programmer" Else Label1.ForeColor = vbYellow Frm_Info_Tombol.Caption = "Aplikasi Pembayaran Kursus" End If End Sub
82
T. Listing Program Fom Info Programmer Private Sub cmdok_Click() psn = MsgBox("Yakin Anda Ingin Keluar", 32 + 4, "Informasi") If psn = 6 Then MsgBox " Balik Lagi Kemenu Utama", 32, "Informasi" Unload Me Else If psn = vbNo Then MsgBox " Kok Enggak Jadi Keluar...Ada Apa Nich", 32, "Ragukan" End If End If End Sub Private Sub Timer1_Timer() Static showcaption As Boolean showcaption = Not showcaption If showcaption Then Label7.ForeColor = vbRed Frm_Info_Programmer.Caption = "Biodata Programmer" Else Label7.ForeColor = vbYellow Frm_Info_Programmer.Caption = "Aplikasi Pembayaran Kursus" End If End Sub