Program Pembayaran SPP
Program Pembayaran SPP
Langkah awal buat database dengan manaDbSekolah.mdb dengan 5 Tabel sebagi berikut:
Hidayatul Rahman
Web : http://edukasi-informatika.blogspot.com
Hidayatul Rahman
Propertis
Caption : Form Pembayaran SPP
Text = Kosongkan
Text = Kosongkan
Text = Kosongkan
Text = Kosongkan
Text = Kosongkan
Text = Kosongkan
Text = 0
Text = 0
Text = 0
Text = 0
Text = 0
Text = 0
Text = 0
Text = 0
Name
FrmSPP
TxtNIS
TxtNama
TxtAlamat
TxtJurusan
TxtProg
TxtKelas
TxtSPP
TxtPraktek
TxtOsis
TxtUjian
TxtLap
TxtAdm
TxtBeasiswa
TxtTotal
Web : http://edukasi-informatika.blogspot.com
TextBox15
TextBox16
TextBox17
Frame
Label1
Label2
Label3
Label4
Label5
Label6
Label7
Label8
Label9
Label10
Label11
Label12
Label13
Label14
Label15
Label16
Label17
Label18
Label19
Label20
Command Botton1
Command Botton2
Command Botton3
Adodc1
Adodc2
Adodc3
Adodc4
DataGrid1
DataGrid2
DataGrid3
DataGrid4
Shape1
Shape2
Shape3
Timer1
Text = 0
Text = 0
Text = Kosongakan
Caption = NIS
Caption = Nama
Caption = Alamat
Caption = Jurusan
Caption = Program Kehlian
Caption = Kelas
Caption = SPP
Caption = Praktek
Caption = Osis
Caption = UJian
Caption = Praktek Lapangan
Caption = Administrasi
Caption = 00:00:00
Caption = __/__/____
Caption = Operator
Caption = Pembayaran SPP
Caption = Beasiswa
Caption = Total
Caption = Bayar
Caption = Kembali
Caption=Catak/Simpan
Caption=Refresh
Caption=Laporan
BorderWidh= 3
BorderWidh= 3
BackStyle= 1-Opaque
Interval =1
TxtBayar
TxtKembali
TxtOperator
Frame1
Label1
Label2
Label3
Label4
Label5
Label6
Label7
Label8
Label9
Label10
Label11
Label12
LbJam
LbTgl
Label15
Label16
Label17
Label18
Label19
Label20
CmdSimpan
CmdRefresh
CmdLaporan
Adodc1
Adodc2
Adodc3
Adodc4
DataGrid1
DataGrid2
DataGrid3
DataGrid4
Shape1
Shape2
Shape3
Timer1
Kemudian Membuat Menunya dengam memilih menu TOOL kemudian pilih MenuEditor
Hidayatul Rahman
Web : http://edukasi-informatika.blogspot.com
Tabel Menu:
Caption
File
Data Siswa
Exit
Laporan
Laporan Data Siswa
Laporan Pembayaran
Seting
Seting Nilai Pembayaran
Seting Admin
Help
About
Name
nmFile
Nmdata
Psh
nmExit
Nmlap
Nmdatasiswa
nmPembayaran
nmset
snmsetnilai
nmsetadm
nmHelp
NmAbout
Hidayatul Rahman
Web : http://edukasi-informatika.blogspot.com
Hidayatul Rahman
Web : http://edukasi-informatika.blogspot.com
.Fields("Tanggal") = LbTgl.Caption
.Fields("Jam") = LbJam.Caption
End With
'Melaporkan jika sudah tersimpan
MsgBox "Data telah di Simpan!", vbInformation + vbOKOnly = vbIgnore
Call CmdRefrash_Click
End Sub
Private Sub Form_Activate()
memanggil nama Operator dari table Aktifvitas Operator
TxtOperator.Text = Adodc4.Recordset!Administrator
Dim t$
Dim thn$, bln$, tgl$
t = MaskEdBox1.Text
If t <> "__/__/__" Then
thn = Right(t, 4)
bln = Mid(t, 4, 2)
tgl = Left(t, 2)
If IsDate(thn & "-" & bln & "-" & tgl) = False Then
MaskEdBox1.Text = Format(Now, "dd/MM/yyyy")
LbTgl.Caption = MaskEdBox1.Text
End If
End If
End Sub
Private Sub Form_Load()
If Not konek() Then
MsgBox "Gak bisa terhubung ke database!", vbCritical
End
End If
Adodc1.ConnectionString = koneksi.ConnectionString
Adodc1.RecordSource = "Siswa"
Set DataGrid1.DataSource = Adodc1
Adodc2.ConnectionString = koneksi.ConnectionString
Adodc2.RecordSource = "Seting"
Set DataGrid2.DataSource = Adodc2
Adodc3.ConnectionString = koneksi.ConnectionString
Adodc3.RecordSource = "Pembayaran"
Set DataGrid3.DataSource = Adodc3
Adodc4.ConnectionString = koneksi.ConnectionString
Adodc4.RecordSource = "AktifvitasOP"
Set DataGrid4.DataSource = Adodc4
End Sub
Private Sub nmAbout_Click()
FrmAbout.Show
End Sub
Hidayatul Rahman
Web : http://edukasi-informatika.blogspot.com
Hidayatul Rahman
Web : http://edukasi-informatika.blogspot.com
Call CmdSimpan_Click
End If
End Sub
Private Sub TxtBeasiswa_Change()
TxtTotal = (Val(TxtSPP.Text) + Val(TxtPraktek.Text) + Val(TxtOsis.Text) + Val(TxtUjian.Text) +
Val(TxtLap.Text) + Val(TxtAdm.Text)) - Val(TxtBeasiswa)
End Sub
Private Sub TxtBeasiswa_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
TxtBayar.SetFocus
End If
End Sub
Private Sub TxtNIS_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
memanggil data dari table siswa
Adodc1.Recordset.Find "NIS='" + TxtNIS.Text + "'", , adSearchForward, 1
If Not Adodc1.Recordset.EOF Then
TxtNama.Text = Adodc1.Recordset.Fields("Nama")
TxtAlamat.Text = Adodc1.Recordset.Fields("Alamat")
TxtJurusan.Text = Adodc1.Recordset.Fields("Jurusan")
TxtProg.Text = Adodc1.Recordset.Fields("Keahlian")
TxtKelas.Text = Adodc1.Recordset.Fields("Kelas")
'memanggil data dari tabel seting
Adodc2.Recordset.Find "Progm_Keahlian='" + TxtProg.Text + "'", , adSearchForward, 1
If Not Adodc2.Recordset.EOF Then
TxtSPP.Text = Adodc2.Recordset!SPP
TxtPraktek.Text = Adodc2.Recordset!Praktek
TxtOsis.Text = Adodc2.Recordset!Osis
TxtUjian.Text = Adodc2.Recordset!Ujian
TxtLap.Text = Adodc2.Recordset!Praktek_Lap
TxtAdm.Text = Adodc2.Recordset!Administrasi
TxtBeasiswa.SetFocus
Else
MsgBox "Maaf, Seting Tidak Ditemukan!"
End If
Else
MsgBox "Maaf, Data Tidak Ditemukan!"
TxtNIS.Text = ""
TxtNIS.SetFocus
End If
TxtTotal = (Val(TxtSPP.Text) + Val(TxtPraktek.Text) + Val(TxtOsis.Text) + Val(TxtUjian.Text) +
Val(TxtLap.Text) + Val(TxtAdm.Text))
End If
End Sub
Hidayatul Rahman
Web : http://edukasi-informatika.blogspot.com
Form SiSwa
Tabel Tool :
Tool
Form
TextBox1
TextBox2
TextBox3
TextBox4
TextBox5
Hidayatul Rahman
Propertis
Caption: Data Siswa
BackColor(Biru)
Name
FrmSiswa
TxtNIS
TxtNama
TxtAlamat
TxtTmpLahir
TxtAgama
Web : http://edukasi-informatika.blogspot.com
TextBox6
TextBox7
TextBox8
TextBox9
TextBox10
Label1
Label2
Label3
Label4
Label5
Label6
Label7
Label8
Label9
Label10
Label11
TxtSkolAsal
TxtTahun
TxtKeahlian
TxtKelas
TxtCariName
Caption : NIS
Caption : Nama
Caption : Alamat
Caption : Tempat/Tgl lahir
Caption : Jenis Kelamin
Caption : Agama
Caption : Sekolah asal
Caption : Tahun Masuk
Caption : Jurusan
Caption : Program Keahlian
Caption : Kelas
DTPicker
ComboBox1
ComboBox2
Frame
CommandBotton1
CommandBotton2
CommandBotton3
CommandBotton4
CommandBotton5
CommandBotton6
CommandBotton7
CommandBotton8
Adodc
DataGrid
Label1
Label2
Label3
Label4
Label5
Label6
Label7
Label8
Label9
Label10
Label11
DTPicker1
CboKelamin
CboJurusan
Frame1
CmdSimpan
CmdBatal
CmdEdit
CmdHapus
CmdExit
CmdCatek
CmdRefrash
CmdCari
Adodc1
DataGrid1
Tabel Menu:
Caption
File
Pembayaran
Exit
Laporan
Laporan Siswa
Laporan Pembayaran
Hidayatul Rahman
Name
Nmfile
nmbayar
psh
nmexit
nmLaporan
nmSiswa
nmpembayaran
Web : http://edukasi-informatika.blogspot.com
Help
About
nmhelp
nmAbout
Code Programya:
Option Explicit
Private koneksi As ADODB.Connection
Dim rsseting As New ADODB.Recordset
Private Function konek() As Boolean
On Error GoTo out
Set koneksi = New ADODB.Connection
koneksi.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path &
"\DbSekolah.mdb;Persist Security Info=False"
koneksi.CursorLocation = adUseClient
konek = True
out:
End Function
'Prosedur ketika ComboBox di klik
Private Sub CboJurusan_Click()
If CboJurusan.Tag = "1" Then Exit Sub 'jika kondisi sedang mengisi data keluar aja
Hidayatul Rahman
Web : http://edukasi-informatika.blogspot.com
Hidayatul Rahman
Web : http://edukasi-informatika.blogspot.com
TxtTmpLahir.Text = ""
DTPicker1.Refresh
CboKelamin.Text = ""
TxtAgama.Text = ""
TxtSkolAsal.Text = ""
TxtTahun.Text = ""
CboJurusan.Text = ""
TxtKeahlian.Text = ""
TxtKelas.Text = ""
TxtNIS.SetFocus
'merubah title tombol edit
CmdEdit.Caption = "Edit"
End Sub
'pencarian data dengan menyaring DataGrid
Private Sub CmdCari_Click()
Adodc1.Recordset.Filter = "Nama ='" & TxtCariName & "'"
End Sub
Private Sub CmdCatek_Click()
DataReportSiswa.Show
End Sub
'prosedure ketika tombol edit di klik
Private Sub CmdEdit_Click()
If CmdEdit.Caption = "Edit" Then
'merubah title EDIT menjadi UPDATE
CmdEdit.Caption = "Update"
TxtNIS.SetFocus
Else
'proses penggantian data/penympana urang
With Adodc1.Recordset
.Fields("NIS") = TxtNIS.Text
.Fields("Nama") = TxtNama.Text
.Fields("Alamat") = TxtAlamat.Text
.Fields("Tempat_Lhr") = TxtTmpLahir.Text
.Fields("Tgl_Lahir") = Format(DTPicker1, "mm/dd/yyyy")
.Fields("JenisKelamin") = CboKelamin.Text
.Fields("Agama") = TxtAgama.Text
.Fields("Sekolah_Asal") = TxtSkolAsal.Text
.Fields("Tahun_Masuk") = TxtTahun.Text
.Fields("Jurusan") = CboJurusan.Text
.Fields("Keahlian") = TxtKeahlian.Text
.Fields("Kelas") = TxtKelas.Text
Hidayatul Rahman
Web : http://edukasi-informatika.blogspot.com
.Update
End With
Adodc1.Refresh
MsgBox "Data telah di Up Date!", vbInformation + vbOKOnly = vbIgnore
Call CmdBatal_Click
End If
End Sub
Private Sub CmdExit_Click()
If MsgBox("Yakin mau keluar?", vbQuestion + vbYesNo) = vbYes Then
Unload Me
End If
End Sub
'prosedure hapus
Private Sub CmdHapus_Click()
'membuat pertanyaan pengamanan sebelum di papus
Dim x As String
x = MsgBox(("Anda Yakin data ingin di hapus?"), vbYesNo + vbCritical)
If x = vbYes Then
'perintah menghapus data
Adodc1.Recordset.Delete
Adodc1.Recordset.MoveFirst
DataGrid1.ReBind
DataGrid1.Refresh
'Membuat laporannya
MsgBox "Data telah di Hapus!", vbInformation + vbOKOnly = vbIgnore
End If
End Sub
Private Sub CmdRefrash_Click()
TxtCariName.Text = ""
Adodc1.Refresh
DataGrid1.Refresh
End Sub
Private Sub CmdSimpan_Click()
'mengecek Nomor Induk Siswa untuk mencegah ada yang sama
Adodc1.Recordset.Find "NIS='" + TxtNIS.Text + "'", , adSearchForward, 1
If Not Adodc1.Recordset.EOF Then
MsgBox ("Nomor Induk Siswa Ini" + TxtNIS.Text + Chr(13) + _
"Sudah Ada !")
TxtNIS.Text = ""
TxtNIS.SetFocus
Hidayatul Rahman
Web : http://edukasi-informatika.blogspot.com
Else
'memerikasa data Texbox yang tidak terisi
If MsgBox("Anda yakin data sudah benar", vbQuestion + vbYesNo) = vbYes Then
If Trim$(TxtNama.Text) = "" Then
MsgBox "Nama harus di isi!", vbExclamation
TxtNama.SetFocus
Exit Sub
ElseIf TxtAlamat.Text = "" Then
MsgBox "Alamat Siswa Harus di isi!", vbExclamation
TxtAlamat.SetFocus
Exit Sub
ElseIf TxtTmpLahir.Text = "" Then
MsgBox "Tempat Lahir Siswa harus di isi!", vbExclamation
TxtTmpLahir.SetFocus
Exit Sub
ElseIf TxtAgama.Text = "" Then
MsgBox "Agama Siswa Harus di isi!", vbExclamation
TxtAgama.SetFocus
Exit Sub
ElseIf TxtSkolAsal.Text = "" Then
MsgBox "Sekolah asal Siswa harus di isi!", vbExclamation
TxtSkolAsal.SetFocus
Exit Sub
End If
End If
'Penyimpanan data ke tabel
With Adodc1.Recordset
.AddNew
.Fields("NIS") = TxtNIS.Text
.Fields("Nama") = TxtNama.Text
.Fields("Alamat") = TxtAlamat.Text
.Fields("Tempat_Lhr") = TxtTmpLahir.Text
.Fields("Tgl_Lahir") = Format(DTPicker1, "mm/dd/yyyy")
.Fields("JenisKelamin") = CboKelamin.Text
.Fields("Agama") = TxtAgama.Text
.Fields("Sekolah_Asal") = TxtSkolAsal.Text
.Fields("Tahun_Masuk") = TxtTahun.Text
.Fields("Jurusan") = CboJurusan.Text
.Fields("Keahlian") = TxtKeahlian.Text
.Fields("Kelas") = TxtKelas.Text
.Update
End With
'Melaporkan jika sudah tersimpan
MsgBox "Data telah di Simpan!", vbInformation + vbOKOnly = vbIgnore
Hidayatul Rahman
Web : http://edukasi-informatika.blogspot.com
Hidayatul Rahman
Web : http://edukasi-informatika.blogspot.com
Hidayatul Rahman
Web : http://edukasi-informatika.blogspot.com
Hidayatul Rahman
Web : http://edukasi-informatika.blogspot.com
Form Seting
Hidayatul Rahman
Web : http://edukasi-informatika.blogspot.com
TOOL
Form
label
label
label
label
label
label
label
label
label
Shape
CommandBotton
CommandBotton
CommandBotton
CommandBotton
CommandBotton
Adodc
DataGrid
Propetis
Caption: Seting Pembayaran
BackColor: Window Freme
StarUpPosition: Center
Caption : ID Set
Caption : Jurusan
Caption : Program Keahlian
Caption : SPP
Caption : Praktek
Caption : Osis
Caption : Ujian
Caption : Praktek Lapangan
Caption : Administrasi
BordeWidth: 3
Caption : Baru
Caption : Batal
Caption : Edit
Caption : Hapus
Caption : Keluar
Name
FrmSeting
Label1
Label2
Label3
Label4
Label5
Label6
Label7
Label8
Label9
Shape1
CmdSimpan
CmdBatal
CmdEdit
CmdHapus
CmdExit
Adodc1
DataGrid1
Code programnya:
Option Explicit
Private koneksi As ADODB.Connection
Dim rstabel As New ADODB.Recordset
Private Function konek() As Boolean
On Error GoTo out
Set koneksi = New ADODB.Connection
koneksi.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path &
"\DbSekolah.mdb;Persist Security Info=False"
koneksi.CursorLocation = adUseClient
konek = True
out:
End Function
Sub bersih()
TxtJurusan.Text = ""
TxtKeahlian.Text = ""
Hidayatul Rahman
Web : http://edukasi-informatika.blogspot.com
TxtSPP.Text = ""
TxtPraktek.Text = "0"
TxtOsis.Text = "0"
TxtUjian.Text = "0"
TxtLap.Text = "0"
TxtAdm.Text = "0"
End Sub
Sub Aktif()
TxtJurusan.Enabled = True
TxtKeahlian.Enabled = True
TxtSPP.Enabled = True
TxtPraktek.Enabled = True
TxtOsis.Enabled = True
TxtUjian.Enabled = True
TxtLap.Enabled = True
TxtAdm.Enabled = True
End Sub
Sub pasif()
TxtJurusan.Enabled = False
TxtKeahlian.Enabled = False
TxtSPP.Enabled = False
TxtPraktek.Enabled = False
TxtOsis.Enabled = False
TxtUjian.Enabled = False
TxtLap.Enabled = False
TxtAdm.Enabled = False
End Sub
Private Sub CmdBatal_Click()
bersih
pasif
CmdSimpan.Caption = "Baru"
CmdEdit.Caption = "Edit"
CmdHapus.Enabled = True
CmdSimpan.Enabled = True
End Sub
Private Sub CmdEdit_Click()
If CmdEdit.Caption = "Edit" Then
TxtID.Enabled = True
TxtID.SetFocus
Aktif
Hidayatul Rahman
Web : http://edukasi-informatika.blogspot.com
Hidayatul Rahman
Web : http://edukasi-informatika.blogspot.com
Aktif
TxtJurusan.SetFocus
Else
If MsgBox("Anda yakin data sudah benar", vbQuestion + vbYesNo) = vbYes Then
If Trim$(TxtJurusan.Text) = "" Then
MsgBox "Jurusan harus di isi!", vbExclamation
TxtJurusan.SetFocus
Exit Sub
ElseIf TxtKeahlian.Text = "" Then
MsgBox "Program Keahlian Harus di isi!", vbExclamation
TxtKeahlian.SetFocus
Exit Sub
ElseIf TxtSPP.Text = "" Then
MsgBox "SPP harus di isi!", vbExclamation
TxtSPP.SetFocus
Exit Sub
End If
With Adodc1.Recordset
.AddNew
.Fields("Jurusan") = TxtJurusan.Text
.Fields("Progm_Keahlian") = TxtKeahlian.Text
.Fields("SPP") = TxtSPP.Text
.Fields("Praktek") = TxtPraktek.Text
.Fields("Osis") = TxtOsis.Text
.Fields("Ujian") = TxtUjian.Text
.Fields("Praktek_Lap") = TxtLap.Text
.Fields("Administrasi") = TxtAdm.Text
.Update
End With
Adodc1.Refresh
DataGrid1.Refresh
MsgBox "Data telah di Simpan!", vbInformation + vbOKOnly = vbIgnore
Call CmdBatal_Click
End If
End If
End Sub
Private Sub Form_Load()
If Not konek() Then
MsgBox "Gak bisa terhubung ke database!", vbCritical
End
End If
Adodc1.ConnectionString = koneksi.ConnectionString
Adodc1.RecordSource = "Seting"
Hidayatul Rahman
Web : http://edukasi-informatika.blogspot.com
Hidayatul Rahman
Web : http://edukasi-informatika.blogspot.com
Hidayatul Rahman
Web : http://edukasi-informatika.blogspot.com
Form Login
PROPERTIS
BordeStyle : Fixed Single
StartUpPosition: center
CommandBotton Caption : OK
CommandBotton Caption : Batal
TextBox
TextBox
TextBox
Visible= False
Label
Caption:Administrator Name
Label
Caption : Password
Label
Visible=false
Label
Visible=false
MaskEdBox
Visible =false
Adodc
Hidayatul Rahman
NAME
FrmLogin
CmdOK
CmdBatal
TxtAdmin
TxtPass
TextCek
Label1
Label2
LbJam
LbName
MaskEdBox1
Adodc1
Web : http://edukasi-informatika.blogspot.com
Adodc
DataGrid
Datagrid
Timer
Interval =1
Adodc2
DataGrid1
DataGrid2
Timer1
Hidayatul Rahman
Web : http://edukasi-informatika.blogspot.com
MsgBox "Password& Admin SALAH, masukkan lagi Admin & passwordnya!" & Chr(10) &
"Kesempatan anda" & 3 - x & " lagi", vbOKOnly + vbCritical, "Password Salah"
x=x+1
TxtAdmin.Text = ""
TxtPass = ""
TextCek.Text = "rtbr345435*&^#2325hhutyu6788"
TxtAdmin.SetFocus
Exit Sub
End If
End If
End Sub
Private Sub Form_Activate()
mengatur tiggi form Login
FrmLogin.Height = 3300
x=1
Kode Mengseting tanggal
Dim t$
Dim thn$, bln$, tgl$
t = MaskEdBox1.Text
If t <> "__/__/__" Then
thn = Right(t, 4)
bln = Mid(t, 4, 2)
tgl = Left(t, 2)
If IsDate(thn & "-" & bln & "-" & tgl) = False Then
MaskEdBox1.Text = Format(Now, "dd/MM/yyyy")
End If
End If
End Sub
Private Sub Form_Load()
If Not konek() Then
MsgBox "Gak bisa terhubung ke database!", vbCritical
End
End If
Adodc1.ConnectionString = koneksi.ConnectionString
Adodc1.RecordSource = "Login"
Set DataGrid1.DataSource = Adodc1
Adodc2.ConnectionString = koneksi.ConnectionString
Adodc2.RecordSource = "AktifvitasOP"
Set DataGrid1.DataSource = Adodc2
End Sub
Hidayatul Rahman
Web : http://edukasi-informatika.blogspot.com
End If
TxtPass.SetFocus
End If
End Sub
Private Sub TxtPass_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Call CmdOK_Click
End If
End Sub
Hidayatul Rahman
Web : http://edukasi-informatika.blogspot.com
Tabel TOOL :
Tool
Form
TextBox
TextBox
TextBox
TextBox
TextBox
TextBox
Label
Label
Hidayatul Rahman
Propertis
Caption: Seting Administrator
BorderStyle :FixedSingle
Text:
Text:
Text:
Text:
Text:
Text: *&&^HBBM":JIUvdf*&^$@!)
Caption :Administrator Name
Lama BackStyle : Tramforent
Caption :Password lama
BackStyle : Tramforent
Name
FrmAdmin
Textadm
Textpass
TxtAdm
TxtPass
TxtNama
Text1
Label1
Label2
Web : http://edukasi-informatika.blogspot.com
Label
Label
Label
Shape
Shape
Timer
Timer
CommandBotton
CommandBotton
CommandBotton
CommandBotton
CommandBotton
Adodc
DataGrid
Caption : Ganti
Caption : Batal
Caption : Tambah
Caption : Hapus
Caption : Keluar
Label3
Label4
Label5
Shape1
Shape2
Timer1
Timer2
CmdGanti
CmdBatal
CmdTambah
CmdHapus
CmdKeluar
Adodc1
DataGrid1
Kode Programnya:
Option Explicit
Dim posTengah As Integer
Private koneksi As ADODB.Connection
Private Function konek() As Boolean
On Error GoTo out
Set koneksi = New ADODB.Connection
koneksi.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path &
"\DbSekolah.mdb;Persist Security Info=False"
koneksi.CursorLocation = adUseClient
konek = True
out:
End Function
Sub CekPass()
If Textpass.Text = Text1.Text Then
Else
MsgBox "Adminstrator Name & Password tidak cocok ini!", vbOKOnly + vbCritical,
"UnAuthorized"
Textadm.Text = ""
Hidayatul Rahman
Web : http://edukasi-informatika.blogspot.com
Textpass.Text = ""
Text1.Text = "5457hhh43%*tyy*&^.,ll%$$#$#$"
End If
End Sub
Private Sub CmdBatal_Click()
Textadm.Text = ""
Textpass.Text = ""
TxtAdm.Text = ""
TxtPass.Text = ""
TxtNama.Text = ""
CmdGanti.Caption = "Ganti"
CmdTambah.Caption = "Tambah"
CmdTambah.Enabled = True
CmdKeluar.Enabled = True
End Sub
Private Sub CmdGanti_Click()
If CmdGanti.Caption = "Ganti" Then
CmdGanti.Caption = "Simpan"
CmdTambah.Enabled = False
CmdKeluar.Enabled = False
Textadm.SetFocus
Else
CekPass
With Adodc1.Recordset
.Fields("Administrator") = TxtAdm.Text
.Fields("Pasword") = TxtPass.Text
.Fields("Nama") = TxtNama.Text
.Update
End With
MsgBox "Nana dan Pasword Telah Diganti!", vbInformation + vbOKOnly = vbIgnore
Call CmdBatal_Click
End If
End Sub
Private Sub CmdHapus_Click()
Dim x As String
x = MsgBox(("Anda Yakin data ingin di hapus?"), vbYesNo + vbCritical)
If x = vbYes Then
If Textpass.Text = Text1.Text Then
Adodc1.Recordset.Delete
Adodc1.Recordset.MoveFirst
DataGrid1.ReBind
Hidayatul Rahman
Web : http://edukasi-informatika.blogspot.com
DataGrid1.Refresh
MsgBox "Operator telah di Hapus!", vbInformation + vbOKOnly = vbIgnore
Else
MsgBox "Adminstrator Name & Password tidak cocok ini!", vbOKOnly + vbCritical,
"UnAuthorized"
Textadm.Text = ""
Textpass.Text = ""
TxtNama.Text = ""
Text1.Text = "5457hhh43%*tyy*&^.,ll%$$#$#$"
End If
End If
End Sub
Private Sub CmdKeluar_Click()
If MsgBox("Yakin mau keluar?", vbQuestion + vbYesNo) = vbYes Then
Keluar
End If
End Sub
Sub Keluar()
posTengah = Me.Top
Me.Top = Me.Top + 10
Me.Timer2.Interval = 50
End Sub
Private Sub CmdTambah_Click()
If CmdTambah.Caption = "Tambah" Then
CmdGanti.Enabled = False
CmdHapus.Enabled = False
CmdTambah.Caption = "Simpan"
Else
If MsgBox("Anda yakin data sudah benar", vbQuestion + vbYesNo) = vbYes Then
With Adodc1.Recordset
.AddNew
.Fields("Adminstrator") = TxtAdm.Text
.Fields("Pasword") = TxtPass.Text
.Fields("Nama") = TxtNama.Text
.Update
End With
MsgBox "Operator telah di tambah!", vbInformation + vbOKOnly = vbIgnore
Call CmdBatal_Click
CmdGanti.Enabled = True
CmdHapus.Enabled = True
End If
End If
End Sub
Hidayatul Rahman
Web : http://edukasi-informatika.blogspot.com
Hidayatul Rahman
Web : http://edukasi-informatika.blogspot.com
Me.Timer1.Interval = 0
End If
End Sub
Private Sub Timer2_Timer()
If Me.Top < Screen.Height Then
Me.Top = Me.Top + ((Me.Top - posTengah) * 2)
Else
Unload Me
End If
End Sub
Private Sub TxtAdm_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
TxtPass.SetFocus
End If
End Sub
Private Sub TxtPass_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
TxtNama.SetFocus
End If
End Sub
FORM LAPORAN
Rancangan Formnya:
Hidayatul Rahman
Web : http://edukasi-informatika.blogspot.com
Tabel Tool :
Tool
Form
Pripertis
BackColor:BottonText
StartUpPosition: Center
Caption: Ketikan NIS
Caption: Nama Siswa
Caption: Operator
Caption: Tanggal
Label
Label
Label
Label
TextBox
TextBox
TextBox
DTPicker
Frame
CommandBotton Caption : Refresh BackColor : Kuning
Picture :(ambil gambar) Style:Grafik
CommandBotton Caption :Hapus BackColor : Merah
Picture :(ambil gambar) Style:Grafik
CommandBotton Caption :Cetak Laporan BackColor :
Hijau Picture :(ambil gambar)
Style:Grafik
CommandBotton Caption : Cari
Adodc
DataGrid
Hidayatul Rahman
Name
FrmData
Label1
Label2
Label3
Label4
TxtCari
TxtNama
TxtOperaotor
DTPicker1
Frame1
CmdRefresh
CmdHapus
CmdCetak
CmdCari
Adodc1
DataGrid1
Web : http://edukasi-informatika.blogspot.com
Kode Programnya :
Option Explicit
Private koneksi As ADODB.Connection
Private Function konek() As Boolean
On Error GoTo out
Set koneksi = New ADODB.Connection
koneksi.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path &
"\DbSekolah.mdb;Persist Security Info=False"
koneksi.CursorLocation = adUseClient
konek = True
out:
End Function
Hidayatul Rahman
Web : http://edukasi-informatika.blogspot.com
Adodc1.Recordset.Delete
Adodc1.Recordset.MoveFirst
DataGrid1.ReBind
DataGrid1.Refresh
MsgBox "Data telah di Hapus!", vbInformation + vbOKOnly = vbIgnore
End If
End Sub
Private Sub CmdRefresh_Click()
Adodc1.Refresh
DataGrid1.Refresh
End Sub
Private Sub Form_Load()
If Not konek() Then
MsgBox "Gak bisa terhubung ke database!", vbCritical
End
End If
Adodc1.ConnectionString = koneksi.ConnectionString
Adodc1.RecordSource = "Pembayaran"
Set DataGrid1.DataSource = Adodc1
End Sub
Private Sub TxtCari_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Call CmdCari_Click
End If
End Sub
FORM ABOUT
Rancangan Formnya:
Hidayatul Rahman
Web : http://edukasi-informatika.blogspot.com
Tabel TOOL :
Tool
Form
Label
Label
Label
Image
Timer
Timer
Timer
Propertis
BackColor : WindowFrame
BordeStyle: FixedSingle
Caption: Program Pembayaran
SPP BackStyle: Transfarent
font: sesuai keinginan
Caption: Hidayatul Rahman
BackStyle: Transfarent
SPP font: sesuai keinginan
Caption: ttp://Edukasiinformatika.blogspot.con
BackStyle: Transfarent SPP font:
sesuai keinginan
Picture: ambil Icon
Interval : 6000
Name
FrmAbout
Label1
Label2
Label3
Image1
Timer1
Timer2
Timer3
Kode Programnya :
Option Explicit
Private Declare Function ShellExecute Lib _
"shell32.dll" Alias "ShellExecuteA" _
(ByVal hwnd As Long, _
ByVal lpOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As String, _
Hidayatul Rahman
Web : http://edukasi-informatika.blogspot.com
Hidayatul Rahman
Web : http://edukasi-informatika.blogspot.com
MEMBUAT LAPORAN
A. Membuat Data Environment
1. Buka project baru
2. Klik menu Project
3. Pilih More Activex Designer
4. Pilih Data Environment
5. Klik kanan Connection
6. Properties..
7. Pilih Microsoft Jet 3.51 OLE DB Provider (jika database dibuat dengan
Visdata)
8. Pilih Microsoft Jet 4.0 OLE DB Provider (jika database dibuat dengan
access versi 2000 keatas)
9. Klik Next
10. Klik button Select or enter
database name :
11. Pilih database (di direktori
tertentu)
12. Open
13. Klik Test Connenction
14. Klik OK
15. Klik OK
16. Klik kanan Connection
17. Pilih Add Command
18. Klik kanan Command1
19. Klik Properties..
Hidayatul Rahman
Web : http://edukasi-informatika.blogspot.com
Hidayatul Rahman
Web : http://edukasi-informatika.blogspot.com
Hidayatul Rahman
Web : http://edukasi-informatika.blogspot.com
Hidayatul Rahman
Web : http://edukasi-informatika.blogspot.com
Hidayatul Rahman
Web : http://edukasi-informatika.blogspot.com