Komponen Yang Digunakan :
- Microsoft Ado Data Control 6.0 (OLEDB)
- Microsoft DataGrid Control 6.0 (OLEDB)
- Microsoft Windows Common Controls-2 6.0 (SP6)
Listing Modul :
Public conn As New ADODB.Connection
Public rssiswa As New ADODB.Recordset
Public rspembayaran As New ADODB.Recordset
Public Sub openDB()
Set conn = New ADODB.Connection
Set rssiswa = New ADODB.Recordset
Set rspembayaran = New ADODB.Recordset
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " & App.Path & "\Sekolah.mdb"
End Sub
Listing/Coding :
Sub tampildata()
With rspembayaran
If Not .EOF Then
txtnofak.Text = !no_faktur
txtnis.Text = !nis
txtnama.Text = !nama
txtalamat.Text = !alamat
txtkelas.Text = !kelas
txtjurusan.Text = !jurusan
txtkeahlian.Text = !keahlian
txtspp.Text = !spp
txtpraktek.Text = !praktek
txtosis.Text = !osis
txtujian.Text = !ujian
txtadministrasi.Text = !administrasi
txtbeasiswa.Text = !beasiswa
txttotal.Text = !total
End If
End With
End Sub
Sub auto()
Dim no As String
Dim noint As Integer
With rspembayaran
If .RecordCount = 0 Then
no = "0001"
Else
.MoveLast
noint = Val(Right(!no_faktur, 4)) + 1
no = Right("0000" & noint, 4)
End If
End With
txtnofak.Text = no
End Sub
Sub aktif()
txtnofak.Enabled = True
txtnis.Enabled = True
txtnama.Enabled = True
txtalamat.Enabled = True
txtkelas.Enabled = True
txtjurusan.Enabled = True
txtkeahlian.Enabled = True
txtspp.Enabled = True
txtpraktek.Enabled = True
txtosis.Enabled = True
txtujian.Enabled = True
txtadministrasi.Enabled = True
txtbeasiswa.Enabled = True
txttotal.Enabled = True
txtbayar.Enabled = True
txtkembali.Enabled = True
End Sub
Sub nonaktif()
txtnofak.Enabled = False
txtnis.Enabled = False
txtnama.Enabled = False
txtalamat.Enabled = False
txtkelas.Enabled = False
txtjurusan.Enabled = False
txtkeahlian.Enabled = False
txtspp.Enabled = False
txtpraktek.Enabled = False
txtosis.Enabled = False
txtujian.Enabled = False
txtadministrasi.Enabled = False
txtbeasiswa.Enabled = False
txttotal.Enabled = False
txtbayar.Enabled = False
txtkembali.Enabled = False
End Sub
Sub bersih()
txtnofak.Text = ""
txtnis.Text = ""
txtnama.Text = ""
txtalamat.Text = ""
txtkelas.Text = ""
txtjurusan.Text = ""
txtkeahlian.Text = ""
txtspp.Text = ""
txtpraktek.Text = ""
txtosis.Text = ""
txtujian.Text = ""
txtadministrasi.Text = ""
txtbeasiswa.Text = ""
txttotal.Text = ""
txtbayar.Text = ""
txtkembali.Text = ""
End Sub
Sub tampil()
With rssiswa
If Not .EOF Then
txtnis.Text = !nis
txtnama.Text = !nama
txtalamat.Text = !alamat
txtkelas.Text = !kelas
txtjurusan.Text = !jurusan
txtkeahlian.Text = !keahlian
End If
End With
End Sub
Private Sub Form_Load()
Call openDB
conn.CursorLocation = adUseClient
rspembayaran.Open "Select * from Pembayaran", conn
Set gridpembayaran.DataSource = rspembayaran.DataSource
End Sub
Private Sub Form_Activate()
nonaktif
bersih
cmdinput.Enabled = True
cmdsave.Enabled = False
cmdcancel.Enabled = False
cmddelete.Enabled = False
cmdexit.Enabled = True
cmdinput.Enabled = True
cmdinput.SetFocus
End Sub
Private Sub Timer1_Timer()
txttanggal.Text = Format(Date, "dd-mm-yyyy")
txttanggal.Enabled = False
End Sub
Private Sub cmdinput_Click()
aktif
bersih
auto
txtnofak.Enabled = False
txtnis.SetFocus
cmdinput.Enabled = False
cmdsave.Enabled = True
cmdcancel.Enabled = True
cmddelete.Enabled = True
cmdexit.Enabled = True
End Sub
Private Sub cmdsave_Click()
Dim sqlsave As String
sqlsave = "insert into Pembayaran values('" & txtnofak & "','" & txttanggal & "','" & txtnis & "','" & txtnama & "','" & txtalamat & "','" & txtkelas & "','" & txtjurusan & "','" & txtkeahlian & "','" & txtspp & "','" & txtpraktek & "','" & txtosis & "','" & txtujian & "','" & txtadministrasi & "','" & txtbeasiswa & "','" & txttotal & "')"
conn.Execute sqlsave
MsgBox "Data Telah Tersimpan"
Form_Load
nonaktif
cmdinput.Enabled = True
cmdsave.Enabled = False
cmdcancel.Enabled = True
cmddelete.Enabled = True
cmdexit.Enabled = True
End Sub
Private Sub cmdcancel_Click()
p = MsgBox("Yakin Ingin Membatalkan Penginputan..?!", vbQuestion + vbYesNo, "Question")
If p = vbYes Then
nonaktif
bersih
End If
cmdinput.Enabled = True
cmdsave.Enabled = False
cmdcancel.Enabled = False
cmddelete.Enabled = True
cmdexit.Enabled = True
End Sub
Private Sub cmddelete_Click()
Call openDB
rspembayaran.Open "delete from Pembayara where no_faktur = '" & txtnofak & "'", conn
MsgBox "Data Telah Terhapus"
Form_Load
bersih
nonaktif
cmdinput.Enabled = True
cmddelete.Enabled = True
cmdcancel.Enabled = False
cmdexit.Enabled = True
cmdsave.Enabled = False
End Sub
Private Sub cmdexit_Click()
p = MsgBox("Yakin Ingin Keluar Dari Program Ini....?!?", vbQuestion + vbYesNo, "Question")
If p = vbYes Then
End
End If
End Sub
Private Sub txtnis_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Call openDB
rssiswa.Open "select * from Siswa where nis = '" & txtnis & "'", conn
If rssiswa.EOF Then
MsgBox "NIS Yang Anda Masukan Tidak Ada"
txtnis.Text = ""
txtnis.SetFocus
Else
tampil
txtkeahlian.SetFocus
End If
End If
End Sub
Private Sub txtkeahlian_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If txtkeahlian.Text = "Mekanik Otomotif" Then
txtspp.Text = "160000"
txtpraktek.Text = "220000"
txtosis.Text = "25000"
txtujian.Text = "80000"
txtadministrasi.Text = "5000"
ElseIf txtkeahlian.Text = "Programing" Then
txtspp.Text = "140000"
txtpraktek.Text = "400000"
txtosis.Text = "25000"
txtujian.Text = "80000"
txtadministrasi.Text = "5000"
Else
txtspp.Text = "150000"
txtpraktek.Text = "300000"
txtosis.Text = "25000"
txtujian.Text = "80000"
txtadministrasi.Text = "5000"
End If
End If
txtbeasiswa.SetFocus
End Sub
Private Sub txtbeasiswa_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txttotal.Text = (Val(txtspp.Text) + Val(txtpraktek.Text) + Val(txtosis.Text) + Val(txtujian.Text) + Val(txtadministrasi.Text)) - Val(txtbeasiswa.Text)
txtbayar.SetFocus
End If
End Sub
Private Sub txtbayar_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtkembali.Text = Val(txtbayar.Text) - Val(txttotal.Text)
nonaktif
cmdsave.SetFocus
End If
End Sub
Update Contact :
No Wa/Telepon (puat) : 085267792168
No Wa/Telepon (fajar) : 085369237896
Email : Fajarudinsidik@gmail.com
No Wa/Telepon (puat) : 085267792168
No Wa/Telepon (fajar) : 085369237896
Email: Fajarudinsidik@gmail.com
atau Kirimkan Private messanger melalui email dengan klik tombol order dibawah ini :