82
1 A. Lampiran C1 FORM COPER

Program Pembayaran Kursus With Visual Basic

Embed Size (px)

DESCRIPTION

Program Pembayaran kursus ini hanya di hanya ada Form dan listing program masing2 Form na aja............SELAMAT MEMPELAJARINYA.....

Citation preview

Page 1: Program Pembayaran Kursus With Visual Basic

1

A. Lampiran C1

FORM COPER

Page 2: Program Pembayaran Kursus With Visual Basic

2

Lampiran C2

FORM PASSWORD

Page 3: Program Pembayaran Kursus With Visual Basic

3

Lampiran C3

FORM MENU UTAMA

Page 4: Program Pembayaran Kursus With Visual Basic

4

Lampiran C4

FORM PEMASUKKAN DATA SISWA

Page 5: Program Pembayaran Kursus With Visual Basic

5

B. Lampiran C5

FORM PEMASUKKAN PROGRAM KURSUS

Page 6: Program Pembayaran Kursus With Visual Basic

6

C. Lampiran C6

FORM PEMBAYARAN

Page 7: Program Pembayaran Kursus With Visual Basic

7

D. Lampiran C7

FORM BUKTI PEMBAYARAN

Page 8: Program Pembayaran Kursus With Visual Basic

8

E. Lampiran C8

FORM LAPORAN SISWA

Page 9: Program Pembayaran Kursus With Visual Basic

9

F. Lampiran C9

FORM LAPORAN PROGRAM

Page 10: Program Pembayaran Kursus With Visual Basic

10

G. Lampiran C10

FORM LAPORAN PEMBAYARAN

Page 11: Program Pembayaran Kursus With Visual Basic

11

H. Lampiran C11

FORM INFO TOMBOL

Page 12: Program Pembayaran Kursus With Visual Basic

12

Lampiran C12

Page 13: Program Pembayaran Kursus With Visual Basic

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

Page 14: Program Pembayaran Kursus With Visual Basic

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

Page 15: Program Pembayaran Kursus With Visual Basic

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

Page 16: Program Pembayaran Kursus With Visual Basic

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

Page 17: Program Pembayaran Kursus With Visual Basic

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

Page 18: Program Pembayaran Kursus With Visual Basic

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

Page 19: Program Pembayaran Kursus With Visual Basic

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

Page 20: Program Pembayaran Kursus With Visual Basic

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

Page 21: Program Pembayaran Kursus With Visual Basic

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

Page 22: Program Pembayaran Kursus With Visual Basic

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

Page 23: Program Pembayaran Kursus With Visual Basic

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"

Page 24: Program Pembayaran Kursus With Visual Basic

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"

Page 25: Program Pembayaran Kursus With Visual Basic

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

Page 26: Program Pembayaran Kursus With Visual Basic

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

Page 27: Program Pembayaran Kursus With Visual Basic

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

Page 28: Program Pembayaran Kursus With Visual Basic

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

Page 29: Program Pembayaran Kursus With Visual Basic

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

Page 30: Program Pembayaran Kursus With Visual Basic

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"

Page 31: Program Pembayaran Kursus With Visual Basic

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

Page 32: Program Pembayaran Kursus With Visual Basic

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

Page 33: Program Pembayaran Kursus With Visual Basic

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

Page 34: Program Pembayaran Kursus With Visual Basic

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

Page 35: Program Pembayaran Kursus With Visual Basic

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

Page 36: Program Pembayaran Kursus With Visual Basic

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

Page 37: Program Pembayaran Kursus With Visual Basic

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

Page 38: Program Pembayaran Kursus With Visual Basic

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

Page 39: Program Pembayaran Kursus With Visual Basic

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

Page 40: Program Pembayaran Kursus With Visual Basic

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

Page 41: Program Pembayaran Kursus With Visual Basic

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

Page 42: Program Pembayaran Kursus With Visual Basic

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

Page 43: Program Pembayaran Kursus With Visual Basic

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

Page 44: Program Pembayaran Kursus With Visual Basic

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"

Page 45: Program Pembayaran Kursus With Visual Basic

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

Page 46: Program Pembayaran Kursus With Visual Basic

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

Page 47: Program Pembayaran Kursus With Visual Basic

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

Page 48: Program Pembayaran Kursus With Visual Basic

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

Page 49: Program Pembayaran Kursus With Visual Basic

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

Page 50: Program Pembayaran Kursus With Visual Basic

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

Page 51: Program Pembayaran Kursus With Visual Basic

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

Page 52: Program Pembayaran Kursus With Visual Basic

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

Page 53: Program Pembayaran Kursus With Visual Basic

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

Page 54: Program Pembayaran Kursus With Visual Basic

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

Page 55: Program Pembayaran Kursus With Visual Basic

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

Page 56: Program Pembayaran Kursus With Visual Basic

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

Page 57: Program Pembayaran Kursus With Visual Basic

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

Page 58: Program Pembayaran Kursus With Visual Basic

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

Page 59: Program Pembayaran Kursus With Visual Basic

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

Page 60: Program Pembayaran Kursus With Visual Basic

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

Page 61: Program Pembayaran Kursus With Visual Basic

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

Page 62: Program Pembayaran Kursus With Visual Basic

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

Page 63: Program Pembayaran Kursus With Visual Basic

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

Page 64: Program Pembayaran Kursus With Visual Basic

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

Page 65: Program Pembayaran Kursus With Visual Basic

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;

Page 66: Program Pembayaran Kursus With Visual Basic

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

Page 67: Program Pembayaran Kursus With Visual Basic

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"

Page 68: Program Pembayaran Kursus With Visual Basic

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

Page 69: Program Pembayaran Kursus With Visual Basic

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

Page 70: Program Pembayaran Kursus With Visual Basic

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

Page 71: Program Pembayaran Kursus With Visual Basic

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

Page 72: Program Pembayaran Kursus With Visual Basic

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

Page 73: Program Pembayaran Kursus With Visual Basic

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

Page 74: Program Pembayaran Kursus With Visual Basic

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

Page 75: Program Pembayaran Kursus With Visual Basic

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

Page 76: Program Pembayaran Kursus With Visual Basic

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

Page 77: Program Pembayaran Kursus With Visual Basic

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

Page 78: Program Pembayaran Kursus With Visual Basic

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

Page 79: Program Pembayaran Kursus With Visual Basic

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

Page 80: Program Pembayaran Kursus With Visual Basic

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"

Page 81: Program Pembayaran Kursus With Visual Basic

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

Page 82: Program Pembayaran Kursus With Visual Basic

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