BAB VI
PENUTUP
6.1
KESIMPULAN
Setelah melakukan semua tahapan metode yang telah diuraikan hasil
yang diharapkan dari analisis dan perancangan Aplikasi Pengolahan Data
Simpan Pinjam Koperasi Nurani Timor Kupang
adalah:
a.
Dengan adanya sistem aplikasi pengolahan data simpan pinjam secara
terkomputerisasi ini dapat memperbaiki dan meningkatkan kinerja
sistem yang digunakan pada Koperasi Serba Usaha Nurani Timor
dalam proses pengolahan data simpan pinjam yaitu mempermudah
bendahara untuk
input data, edit data, cari data, pembuatan laporan
secara cepat, tepat dan akurat.
b.
Dengan adanya
client server
ini untuk mempermudah bagian
bendahara dan ketua koperasi dapat
sharing data antar komputer
dengan cepat, tepat dan akurat.
6.2
SARAN
Oleh karena keterbatasan waktu dan kemampuan maka peneliti ingin
menyarankan kedepannya sistem pengolahan data simpan pinjam yang
berbasis desktop ini dapat dikembangkan lebih lanjut dengan berbasis web.
Daftar Pustaka
Aryosurio, K., 2010,
Microsoft Visual Basic 6.0, PT. Elex Media
Komputindo, Jakarta.
Budi, S., 2010,
Konsep Dan Aplikasi Pemrograman Client Server Dan
Sistem Terdistribus, BukuKita.com, Jakarta.
Davis, G., 2011, Kerangka Dasar Sistem Informasi Manajemen Bagian I,
PT Pustaka Binaan Pressindo, Jakarta.
Ghurfan, A. Y., 2013, Perancangan Aplikasi Koperasi Multiguna Berbasis
Web,
Skripsi, Teknik Informatika, Universitas Islam Negeri Sunan
Kalijaga, Yogyakarta.
Jogiyanto, 2010,
Analisis dan Desain Sistem Informasi, Bisnis, Edisi III,
Andi Offset, Yogyakarta.
Kadir, A., 2011, Aplikasi Sistem Informasi Manajemen Bagi Pemerintah
di Era Otonomi Daerah, PT Elex Media Komputindo, Yogyakarta.
Nursal, A., 2011, Belajar Bersama Microsoft Visual Basic 6.0 dan Crystal
Report 8.5. BukuKita.com, Jakarta.
Permana, K., 2011, Perancangan Aplikasi Administrasi Simpan Pinjam
Pada Koperasi Purnama Jaya Menggunakan Visual Basic.Net,
Skripsi,
Teknik Informatika, Universitas Mercu Buana, Jakarta.
Rahmayanti, 2010, Aplikasi Kepegawaian Pada Kantor Kesatuan dan
Bangsa dan Perlindungan Masyarakat Kota Salatiga,
Skripsi, Ilmu
Komputer, Universitas Diponegoro, Semarang.
Salemba, 2010,
Koperasi Unit Usaha Perdagangan, Toko Buku
Palasarionline.com.
Simatupang, 2010,
Pengenalan Sistem Informasi, PT Toko Gunung
Agung, Yogyakarta.
Sunyoto, A., 2010,
Pemrograman Database Menggunakan Microsoft
Visual Basic 6.0 dan SQL Server 2000, PT. Elex Media Komputindo,
Jakarta.
Wibowo, E., 2012, Rancang Bangun Aplikasi Pengolahan Data Simpan
Pinjam Pada Koperasi Bhina Raharja,
Skripsi, Teknik Informatika,
Amikom, Yogyakarta.
Wahyono, T., 2011, Membuat Program Akuntansi Sendiri Untuk Koperasi
Dengan Microsoft Visual Basic.Net,
PT Elex Media Komputindo,
Yogyakarta.
Yoga, M. P., 2012, Pembuatan Aplikasi Pengolahan Data Pegawai
Disnaketranssos Kabupaten Boyolali menggunakan Netbeans 6.9,
Skripsi,
Teknik Informatika, Amikom, Yokyakarta.
Zakaria, M. T., Chandra, C., 2007, Panduan Praktis Microsoft Visio 2007.
BukuKita.com, Jakarta.
LAMPIRAN CODING
1.Coding Form Loading
Private Sub Timer1_Timer()
ProgressBar1.Value = ProgressBar1.Value + 2 Timer1.Enabled = False Unload Me Login.Show End If End Sub
Private Sub Timer2_Timer() Static count As Integer
If count < 1 Then Label1.Caption = "Loading..." count = count + 1
ElseIf count < 2 Then Label1.Caption = "Loading..." count = count + 1
ElseIf count < 3 Then
Label1.Caption = "Loading..." count = count + 1
ElseIf count < 4 Then
Label1.Caption = "Proses masuk aplikasi" count = count + 1
ElseIf count < 5 Then
Label1.Caption = "Proses masuk aplikasi" count = count + 1
ElseIf count < 6 Then
Label1.Caption = "Proses masuk aplikasi" count = count + 1
ElseIf count < 7 Then
Label1.Caption = "Silahkan tunggu" count = count + 1
ElseIf count < 8 Then
Label1.Caption = "Silahkan tunggu" count = count + 1
ElseIf count < 9 Then
Label1.Caption = "Masuk aplikasi" count = count + 1
ElseIf count < 10 Then
Label1.Caption = "Proses..." count = count + 1
ElseIf count < 11 Then
Label1.Caption = "Proses..." count = count + 1 Unload Me Login.Show End If End Sub
2. Coding Form Login
Private Sub cmdlogin_Click() ConnectDb
sql = "select * from Login1 where nama = '" & txtnama.Text & Set oKoperasi = cnKoperasi.Execute(sql)
If Not oKoperasi.EOF Then With mdiUtama .Show
.mnuAnggota.Enabled = True .mnuBayar.Enabled = True .mnuBayar.Enabled = True .mnuDaftarAnggota.Enabled = True .mnuExit.Enabled = True .mnuLapPinjaman.Enabled = True .mnuLapSimpanan.Enabled = True .mnuPinjaman.Enabled = True .mnuSimpanan.Enabled = True .Timer1.Enabled = True .Toolbar1.Enabled = True .Toolbar1.Enabled = True End With Unload Me Else
MsgBox ("Periksa user dan password anda, data masih salah..."), vbInformation, "info.." txtnama.Text = ""
txtpass.Text = "" txtnama.SetFocus End If
End Sub
Private Sub cmdTutup_Click() Unload Me
End Sub
Private Sub Form_Load() txtnama.Enabled = True Call menu End Sub Sub menu() With mdiUtama .Show .mnuAnggota.Enabled = False .mnuBayar.Enabled = False .mnuBayar.Enabled = False .mnuDaftarAnggota.Enabled = False .mnuLapPinjaman.Enabled = False .mnuLapSimpanan.Enabled = False .mnuPinjaman.Enabled = False .mnuSimpanan.Enabled = False .Timer1.Enabled = False .Toolbar1.Enabled = False End With End Sub
Private Sub txtnama_KeyPress(KeyAscii As Integer) KeyAscii = Asc(UCase(Chr(KeyAscii)))
If KeyAscii = 13 Then ConnectDb
oKoperasi.Open"select*From Login1 where nama='"& txtnama.Text &"'" If txtnama = "" Then
MsgBox "User name masih salah", vbInformation, "Info" txtnama.SetFocus Else txtpass.Enabled = True txtpass.SetFocus End If End If End Sub
Private Sub txtpass_KeyPress(KeyAscii As Integer) KeyAscii = Asc(UCase(Chr(KeyAscii)))
If KeyAscii = 13 Then ConnectDb
oKoperasi.Open "select*from Login1 where nama='"& txtpass.Text &"'", If txtpass = "" Then
MsgBox "User name masih salah", vbInformation, "Info" txtpass.SetFocus Else cmdlogin.Enabled = True cmdlogin.SetFocus End If End If End Sub
3. Coding Form Menu Utama
Private Sub MDIForm_Load()
Me.Caption = "Koperasi Serba Usaha System" End Sub
Private Sub mnuAnggota_Click() Anggota.Show
End Sub
Private Sub mnuBayar_Click() frmBayar.Show
End Sub
Private Sub mnuDaftarAnggota_Click() Me.MousePointer = 11
With CrtLaporan .Reset
.ReportFileName = App.Path & "\ANGGOTALAP.rpt" .DataFiles(0) = App.Path & "\dbKSUsys.mdb" .WindowMinButton = False .WindowShowCancelBtn = True .WindowShowCloseBtn = True .WindowParentHandle = mdiUtama.hWnd .WindowState = crptMaximized .Action = 1 End With Me.MousePointer = 1 End Sub
Private Sub mnuExit_Click() Call Closedb
End Sub
Private Sub mnuLapPembayaran_Click() LapTransaksiPinjaman.Show
End Sub
Private Sub mnuLapPinjaman_Click() 'LapAnggotaPinjaman.Show
Me.MousePointer = 11 With CrtLaporan .Reset
.ReportFileName = App.Path & "\PINJAMANLAP.rpt" .DataFiles(0) = App.Path & "\dbKSUsys.mdb"
.Formulas(0) = "Ket='" & " Bulan: " & Space(2) & Format(Now, "mmmm/yyyy") & "'" .WindowMinButton = False
.WindowShowPrintBtn = True .WindowShowPrintSetupBtn = True .WindowParentHandle = mdiUtama.hWnd .WindowState = crptMaximized
.Action = 1 End With
Me.MousePointer = 1 End Sub
Private Sub mnuLapSimpanan_Click() LapSimpan.Show
End Sub
Private Sub mnuPinjaman_Click() frmPinjaman.Show
End Sub
Private Sub mnuSimpanan_Click() frmSimpanan.Show
End Sub
Private Sub mnuttg_Click() Tentang.Show
End Sub
Private Sub Timer1_Timer()
StatusBar1.Panels(5).Text = Format(Now, "HH:MM:SS") End Sub
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button) On Error Resume Next
Select Case Button.Index Case 2 Anggota.Show Case 4 frmPinjaman.Show Case 5 frmBayar.Show Case 7 Closedb End Select End Sub
Private Sub Toolbar1_ButtonDropDown(ByVal Button As MSComctlLib.Button) On Error Resume Next
Select Case Button.Index Case 6
PopupMenu mnuLaporan, 4 End Select
End Sub
4. Coding Form Anggota Option Explicit Dim Kata As String
Private Sub cmdCari_Click()
Kata = InputBox("Masukkan No Anggota Yang akan dicari..", "seacrh...") If Kata = "" Then Exit Sub
Set oKoperasi = Nothing
oKoperasi.Open"Select*from QAnggota Where NoAnggota='"& Kata &"'",cnKoperasi,adOpenDynamic, adLockPessimistic If Not oKoperasi.EOF Then
With oKoperasi txtAnggota.Text = !NoAnggota txtNama.Text = !Nama txtAlamat.Text = !Alamat txtPekerjaan.Text = !Pekerjaan .Close End With
Set oKoperasi = Nothing cmdHapus.Enabled = True cmdEdit.Enabled = True cmdTambah.Caption = "&Batal" Exit Sub End If oKoperasi.Close Set oKoperasi = Nothing
MsgBox " No Anggota [" & Kata & "] tidak terdaftar...", vbCritical End Sub
Private Sub cmdEdit_Click() Fokus txtNama
blnEdit = True
cmdHapus.Enabled = False cmdSimpan.Enabled = True End Sub
Private Sub cmdHapus_Click() On Error GoTo Salah
Kata = MsgBox("Anda Yakin Untuk Menghapus Data Anggota [ " & txtAnggota & "] ini...", vbCritical + vbYesNo) If Kata = vbYes Then
cnKoperasi.Execute "Delete * From QAnggota Where NoAnggota='" & txtAnggota.Text & "'" MsgBox " Data Anggota Telah Di Hapus...", vbInformation
Semula Exit Sub End If Exit Sub Salah:
MsgBox " Data Anggota Tidak Dapat Di Hapus..", vbCritical End Sub
Private Sub cmdSimpan_Click() Me.MousePointer = 11 If Not blnEdit Then simpan Else Edit End If Me.MousePointer = 1 End Sub
Private Sub cmdTambah_Click()
If cmdTambah.Caption = "&Tambah" Then cmdTambah.Caption = "&Batal" GetAutoNumber txtNama.Enabled = True txtNama.SetFocus Else Semula End If End Sub
Private Sub cmdTutup_Click() Unload Me
End Sub
Private Sub Form_Load() Ketengah Me
KeyForm Me End Sub
Sub GetAutoNumber()
Dim Rst As New ADODB.Recordset Dim s As String
Con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\dbKSUsys.mdb;" Rst.Open "select max(right(NoAnggota,6)) as Nomor from tblAnggota", Con, adOpenKeyset
If IsNull(Rst!Nomor) Then
s = "AN000001" 'member nilai awal Else
s = "AN" & Format(Rst!Nomor + 1 - 1 + 1, "000000") End If
Con.Close 'menutup koneksi txtAnggota = s End Sub Sub Semula() ClearControl Me cmdTambah.Caption = "&Tambah" cmdSimpan.Enabled = False End Sub
Private Sub txtAlamat_KeyPress(KeyAscii As Integer) KeyAscii = Asc(UCase(Chr(KeyAscii)))
If KeyAscii = 13 Then If txtAlamat = "" Then
MsgBox "Silakan Lengkapi Data", vbInformation, txtAlamat.SetFocus Else txtKota.Enabled = True txtKota.SetFocus End If End If End Sub
Private Sub txtKota_KeyPress(KeyAscii As Integer)
KeyAscii = Asc(UCase(Chr(KeyAscii))) 'merubha karakter ke kapital If KeyAscii = 13 Then
If txtKota = "" Then
MsgBox "Silakan Lengkapi Data", vbInformation, "Info" txtKota.SetFocus Else txtTelp.Enabled = True txtTelp.SetFocus End If End If End Sub
Private Sub txtnama_KeyPress(KeyAscii As Integer)
KeyAscii = Asc(UCase(Chr(KeyAscii))) 'merubha karakter ke kapital If KeyAscii = 13 Then
If txtNama = "" Then
MsgBox "Silakan Lengkapi Data", vbInformation, txtNama.SetFocus Else txtAlamat.Enabled = True txtAlamat.SetFocus End If End If End Sub Function simpan() On Error GoTo Salah
If cnKoperasi Is Nothing Then
End If
cnKoperasi.Execute "Insert Into tblAnggota Values ('" & txtAnggota.Text & "'," & "'" & txtNama.Text & "'," &
"'" & txtAlamat.Text & "', " & "'" & txtKota & "', " "'" & txtTelp & "', "
"'" & txtPekerjaan.Text & "')" Semula Exit Function Salah: MsgBox Err.Description End Function Function Edit()
On Error GoTo ErrSalah If cnKoperasi Is Nothing Then
If cnKoperasi.State > 0 Then cnKoperasi.Close End If
cnKoperasi.Execute "Update QAnggota Set Nama='" & txtNama.Text & "',Alamat='" & txtAlamat.Text & "', Kota='" & _ txtKota.Text &"'Telp='"& txtTelp.Text &"',Pekerjaan='"& txtPekerjaan.Text &"'Where NoAnggota='"& txtAnggota.Text & Semula
Exit Function ErrSalah:
MsgBox Err.Description End Function
Private Sub txtPekerjaan_KeyPress(KeyAscii As Integer)
KeyAscii = Asc(UCase(Chr(KeyAscii))) 'merubha karakter ke kapital If KeyAscii = 13 Then
If txtPekerjaan = "" Then
MsgBox "Silakan Lengkapi Data", vbInformation, txtPekerjaan.SetFocus Else cmdSimpan.Enabled = True cmdSimpan.SetFocus End If End If End Sub
Private Sub txtTelp_KeyPress(KeyAscii As Integer) KeyAscii = Asc(UCase(Chr(KeyAscii)))
If KeyAscii = 13 Then If txtTelp = "" Then
MsgBox "Silakan Lengkapi Data", vbInformation, "Info" txtTelp.SetFocus Else txtPekerjaan.Enabled = True txtPekerjaan.SetFocus End If End If End Sub
5. Coding Form Simpanan Option Explicit
Dim xTotal As Currency Dim xSaldo As Currency Dim Kata As String
Private Sub cmdCari_Click()
Kata = InputBox("Masukkan No.BA Simpanan Yang akan dicari..", " If Kata = "" Then Exit Sub
Set oKoperasi = Nothing
oKoperasi.Open "Select*from QSimpanan1 Where NoBA='" & Kata & "'", cnKoperasi, adOpenDynamic, If Not oKoperasi.EOF Then
With oKoperasi
dtTanggal.Value = Format(Now, "dd/mm/yyyy")
txtNomor = !NoSimpanan: dtTanggal.Value = !TglSimpanan txtNoBA = !NoBA: txtNoAnggota = !NoAnggota
txtNama = !Nama: txtAlamat = !Alamat txtJenis = !Jenis: txtOID = !OID
txtDebet = Format(!Debet, "#,##0"): txtKredit = Format(!Kredit, "#,##0") txtsaldosw = Format(!SaldoSW, "#,##0"): txtsaldosk = Format(!SaldoSK, "#,##0") txtSaldo = Format(oKoperasi!Total, "#,##0")
.Close End With
Set oKoperasi = Nothing cmdHapus.Enabled = True cmdEdit.Enabled = True cmdTambah.Caption = "&Batal" Exit Sub End If oKoperasi.Close Set oKoperasi = Nothing
MsgBox " NoBA Simpanan [" & Kata & "] tidak terdaftar...", vbCritical End Sub
Private Sub cmdEdit_Click() Fokus txtDebet blnEdit = True cmdHapus.Enabled = False cmdSimpan.Enabled = True cmdCari.Enabled = False cmdEdit.Enabled = False End Sub
Private Sub cmdHapus_Click() On Error GoTo Salah
Kata = MsgBox("Anda Yakin Untuk Menghapus Data Simpanan [ " & txtNoBA & "] ini...") If Kata = vbYes Then
cnKoperasi.Execute "Delete * From tblSimpanan Where NoBA='" & txtNoBA.Text & "'" MsgBox " Data Simpanan Telah Di Hapus...", vbInformation
Semula Exit Sub End If Exit Sub Salah:
MsgBox " Data Simpanan Tidak Dapat Di Hapus..", vbCritical End Sub
Private Sub cmdSimpan_Click() Me.MousePointer = 11 If Not blnEdit Then simpan Else Edit End If Me.MousePointer = 1 End Sub Function simpan() On Error GoTo Salah
If cnKoperasi Is Nothing Then
If cnKoperasi.State > 0 Then cnKoperasi.Close End If
cnKoperasi.Execute "Insert Into tblSimpanan Values ('" & txtNomor.Text & "' "'" & dtTanggal.Value & "'," & _
"'" & txtJenis.Text & "', " & "'" & txtJumlah & "', " & "'" & txtOID.Text & "')"
cnKoperasi.Execute "Insert Into tblDetailSimpanan values ('" & txtNomor.Text & "'," & "'" & txtNoAnggota.Text & "'," &
"'" & txtDebet.Text & "'," & "'" & txtKredit.Text & "'," & "'" & txtsaldosw.Text & "'," & "'" & txtsaldosk.Text & "'," & "'" & txtJumlah.Text & "')"
cnKoperasi.Execute"Update tblDetailSimpanan Set Total='"& txtJumlah &"'Where NoAnggota='"& txtNoAnggota.Text & Semula Exit Function Salah: MsgBox Err.Description End Function Function Edit()
On Error GoTo ErrSalah If cnKoperasi Is Nothing Then
If cnKoperasi.State > 0 Then cnKoperasi.Close End If
cnKoperasi.Execute "Update tblSimpanan Set Saldo='" & txtJumlah.Text & "' Where NoSimpanan='" & txtNomor.Text & "'" cnKoperasi.Execute "Update tblDetailSimpanan Set Debet='" & txtDebet.Text & "',Kredit='" & txtKredit.Text & "',
SaldoSW='" & _
txtsaldosw.Text &"',SaldoSK='"&txtsaldosk.Text &"',Total='"&txtJumlah.Text &"'Where NoSimpanan Semula
Exit Function ErrSalah:
MsgBox Err.Description End Function
Private Sub cmdTambah_Click()
If cmdTambah.Caption = "&Tambah" Then cmdTambah.Caption = "&Batal" GetNumber dtTanggal.Enabled = True dtTanggal.SetFocus Else Semula End If End Sub Sub GetNumber()
Dim Counter As String * 11 Dim Hitung As Integer Dim Tgl As String
Query "Select * from tblSimpanan order By [NoSimpanan]" Tgl = Format(Now, "dd/mm/yyyy")
With oKoperasi
If .RecordCount = 0 Then
Counter = "SM-" + Right(Tgl, 2) + Mid(Tgl, 4, 2) Else
.MoveLast
If Left(![NoSimpanan], 7) <> "SM-" + Right(Tgl, 2) + Mid(Tgl, 4, 2) Counter = "SM-" + Right(Tgl, 2) + Mid(Tgl, 4, 2)
Else
Hitung = Val(Right(!NoSimpanan, 4)) + 1
Counter = "SM-" + Right(Tgl, 2) + Mid(Tgl, 4, 2) + Right("0000" & Hitung, 4) End If
End If
dtTanggal.SetFocus End With
End Sub
Private Sub cmdTutup_Click() Unload Me
End Sub
Private Sub dtTanggal_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then
txtJenis.Enabled = True txtJenis.SetFocus End If
End Sub
Private Sub Form_Load() Ketengah Me
dtTanggal.Value = Format(Now, "dd/mm/yyyy") KeyForm Me End Sub Sub Semula() ClearControl Me cmdTambah.Caption = "&Tambah" cmdSimpan.Enabled = False End Sub
Private Sub txtDebet_Change()
If Not IsNumeric(txtDebet) Then txtDebet = "" End Sub
Private Sub txtDebet_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then If txtDebet = "" Then Fokus txtKredit Else txtDebet.Text = Format(txtDebet, "#,##0") txtKredit.Enabled = True txtKredit.SetFocus End If End If End Sub
Private Sub txtJenis_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then
If txtJenis = "" Then
MsgBox "Data tidak boleh kosong !", vbInformation txtJenis.SetFocus Else txtOID.Enabled = True txtOID.SetFocus End If End If End Sub
Private Sub txtJumlah_Change()
If Not IsNumeric(txtJumlah) Then txtJumlah = "" End Sub
Private Sub txtKredit_Change()
If Not IsNumeric(txtKredit) Then txtKredit = "" End Sub
If KeyAscii = 13 Then If txtKredit <> "" Then txtKredit.Text = Format(txtKredit, "#,##0") txtsaldosw.Enabled = True txtsaldosw.SetFocus Exit Sub End If End If End Sub
Private Sub txtnoanggota_KeyPress(KeyAscii As Integer)
KeyAscii = Asc(UCase(Chr(KeyAscii))) 'merubha karakter ke kapital If KeyAscii = 13 Then
If txtNoAnggota <> "" Then
Query "Select * from tblAnggota Where NoAnggota If oKoperasi.EOF Then
oKoperasi.Close Set oKoperasi = Nothing Fokus txtNoAnggota
MsgBox " No Anggota = " & txtNoAnggota & " Tidak Terdaftar..." Exit Sub
End If Daftar
oKoperasi.Close
Query "Select * from QSimpanan1 Where NoAnggota If oKoperasi.EOF Then
oKoperasi.Close Set oKoperasi = Nothing Fokus txtDebet txtsaldoMI.Text = 0 txtSaldo.Text = 0 Exit Sub End If txtSaldo = Format(oKoperasi!Total, "#,##0") oKoperasi.Close
Set oKoperasi = Nothing Fokus txtDebet End If End If End Sub Sub Daftar() With oKoperasi txtNama = !Nama txtAlamat = !Alamat End With End Sub
Private Sub txtNoBA_KeyPress(KeyAscii As Integer) KeyAscii = Asc(UCase(Chr(KeyAscii)))
If KeyAscii = 13 Then If txtNoBA = "" Then
MsgBox "Silakan Lengkapi Data", vbInformation, "Info" txtNoBA.SetFocus Else txtNoAnggota.Enabled = True txtNoAnggota.SetFocus End If End If End Sub
KeyAscii = Asc(UCase(Chr(KeyAscii))) If KeyAscii = 13 Then
If txtOID = "" Then
MsgBox "Silakan Lengkapi Data", vbInformation, "Info" txtOID.SetFocus Else txtNoBA.Enabled = True txtNoBA.SetFocus End If End If End Sub
Private Sub txtSaldo_Change()
If Not IsNumeric(txtSaldo) Then txtSaldo = "" End Sub
Private Sub txtsaldosk_Change()
If Not IsNumeric(txtsaldosk) Then txtsaldosk = "" End Sub
Private Sub txtsaldosk_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then
If txtsaldosk = "" Then
MsgBox "Silahkan Lengkapi Data", vbInformation, "Info" txtsaldosk.SetFocus
Else
txtJumlah.Text = Format(Val(Int(txtSaldo.Text)) + (Int(txtDebet.Text)) + Val(Int(txtsaldosw.Text)) + (Int(txtsaldosk.Text)) cmdSimpan.Enabled = True cmdSimpan.SetFocus End If End If End Sub
Private Sub txtsaldosw_Change()
If Not IsNumeric(txtsaldosw) Then txtsaldosw = ""
End Sub
Private Sub txtsaldosw_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then If txtsaldosw <> "" Then txtsaldosw.Text = Format(txtsaldosw, "#,##0") txtsaldosk.Enabled = True txtsaldosk.SetFocus Exit Sub End If End If End Sub
6. Coding Form Pinjaman Option Explicit
Const xStatus = "Lunas" Const xKet = "Utang" Dim Kata As String
Private Sub cmdCari_Click()
Kata = InputBox("Masukkan No.BA Pinjaman Yang akan dicari..", "Seacrh...") If Kata = "" Then Exit Sub
Set oKoperasi = Nothing
oKoperasi.Open "Select * from QPinjaman Where NoPinjam='" & Kata & "'", If Not oKoperasi.EOF Then
With oKoperasi
txtNoAnggota = !NoAnggota: txtNama = !Nama txtAlamat = !Alamat:
txtKet = !Keterangan: txtPinjaman = Format(![PinjamanPokok], "#,##0") txtLama = !Lama: dtMulai.Value = !tglMulai
dtSelesai = !TglSelesai
txtTotal = Format(![TotalPinjaman], "#,##0"): txtAngsuran dtBayar.Value = !TglBayar
.Close End
Query "Select * from QSimpanan1 Where NoAnggota If oKoperasi.EOF Then oKoperasi.Close
Set oKoperasi = Nothing Exit Sub
End If Daftar
oKoperasi.Close Set oKoperasi = Nothing cmdHapus.Enabled = True cmdEdit.Enabled = True cmdTambah.Caption = "&Batal" Exit Sub End If oKoperasi.Close Set oKoperasi = Nothing
MsgBox " No. BA [" & Kata & "] tidak terdaftar...", vbCritical End Sub Sub MATI() txtNomor.Enabled = False dtTanggal.Enabled = False txtNoAnggota.Enabled = False txtNama.Enabled = False txtAlamat.Enabled = False txtKet.Enabled = False txtPinjaman.Enabled = False txtLama.Enabled = False txtAngsuran.Enabled = False dtMulai.Enabled = False dtSelesai.Enabled = False txtTotal.Enabled = False dtBayar.Enabled = False txtOID.Enabled = False txtSaldo.Enabled = False End Sub
Private Sub cmdEdit_Click() blnEdit = True txtKet.Enabled = True txtKet.SetFocus cmdSimpan.Enabled = True cmdEdit.Enabled = False cmdHapus.Enabled = False cmdCari.Enabled = False End Sub
Private Sub cmdHapus_Click() On Error GoTo Salah
Kata = MsgBox("Anda Yakin Untuk Menghapus Data Pinjaman = " & txtNoAnggota & " ini...", vbCritical + vbYesNo)
If Kata = vbYes Then
cnKoperasi.Execute "Delete From tblPinjaman Where NoPinjam='" & txtNomor.Text & "'" MsgBox " Data Pinjaman Telah Di Hapus...", vbInformation
Semula Exit Sub End If Exit Sub
Salah:
MsgBox " Data Pinjaman Tidak Dapat Di Hapus.." & Chr(10) & _ "Silahkan Periksa Angsuran Anggota...", vbCritical
End Sub
Private Sub cmdSimpan_Click() Me.MousePointer = 11 If Not blnEdit Then Save Else Edit End If Me.MousePointer = 1 End Sub Sub Save()
On Error GoTo Salah If cnKoperasi Is Nothing Then
If cnKoperasi.State > 0 Then cnKoperasi.Close End If
cnKoperasi.Execute "Insert Into tblPinjaman Values ('" & txtNomor.Text & "'," & _ "'" & dtTanggal.Value & "'," & _
"'" & txtNoAnggota.Text & "'," & _ "'" & txtKet.Text & "'," & _ "'" & txtPinjaman.Text & "'," & _ "'" & txtLama.Text & "'," & _ "'" & dtMulai.Value & "'," & _ "'" & dtSelesai.Text & "'," & _ "'" & txtTotal.Text & "'," & _ "'" & txtAngsuran.Text & "'," & _ "'" & dtBayar.Value & "'," & _ "'" & txtOID.Text & "'," & _ "'" & xKet & "')"
Semula Exit Sub Salah:
MsgBox Err.Description End Sub
Private Sub cmdTambah_Click()
If cmdTambah.Caption = "&Tambah" Then cmdTambah.Caption = "&Batal" GetNumber
dtTanggal.Enabled = True
dtTanggal.Value = Format(Now, "dd/mm/yyyy") txtkriteria.Enabled = True txtkriteria = 500000 dtTanggal.SetFocus Else Semula End If End Sub
Private Sub cmdTutup_Click() Unload Me
End Sub
Private Sub dtBayar_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then
txtOID.Enabled = True txtOID.SetFocus End If
Private Sub dtMulai_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then
dtSelesai.Text = DateAdd("m", txtLama.Text, dtMulai.Value) dtBayar.Enabled = True
dtBayar.Value = Format(Now, "dd/mm") dtBayar.SetFocus
End If End Sub
Private Sub dtTanggal_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then Fokus txtNoAnggota
End Sub
Private Sub Form_Load() Ketengah Me
Call MATI End Sub
Sub GetNumber() On Error GoTo Salah Dim Counter As String * 11 Dim Hitung As Integer Dim Tgl As String
Query "Select * from tblPinjaman order By [NoPinjam]" Tgl = Format(Now, "dd/mm/yyyy")
With oKoperasi
If .RecordCount = 0 Then
Counter = "PJ-" + Right(Tgl, 2) + Mid(Tgl, 4, 2) Else
.MoveLast
If Left(![NoPinjam], 7) <> "PJ-" + Right(Tgl, 2) + Mid(Tgl, 4, 2) Then Counter = "PJ-" + Right(Tgl, 2) + Mid(Tgl, 4, 2) + "001"
Else
Hitung = Val(Right(!NoPinjam, 4))
Counter = "PJ-" + Right(Tgl, 2) + Mid(Tgl, 4, 2) + Right("0000" & Hitung, 4) End If End If txtNomor.Enabled = True txtNomor.Text = Counter End With Exit Sub Salah: MsgBox Err.Description End Sub Sub Daftar() With oKoperasi txtNama = !Nama txtAlamat = !Alamat txtSaldo = Format(oKoperasi!Total, "#,##0") End With End Sub Function Semula() ClearControl Me KeyForm Me cmdSimpan.Enabled = False cmdTambah.Caption = "&Tambah" cmdTambah.SetFocus cmdCari.Enabled = True cmdEdit.Enabled = False cmdHapus.Enabled = False End Function
Sub Edit()
On Error GoTo Salah
cnKoperasi.Execute "Update tblPinjaman Set Keterangan='" & txtKet.Text & "',[PinjamanPokok]='" & _ txtPinjaman.Text & "',Lama='" & txtLama.Text & "',TglMulai='" & _
dtMulai.Value & "',TglSelesai='" & dtSelesai.Text & "',[TotalPinjaman]='" & _ txtTotal.Text & "',Angsuran='" & txtAngsuran.Text & "',TglBayar='" & _
dtBayar.Value & "',Status='" & xKet & "' Where NoPinjam='" & txtNomor.Text & "'" Semula
Exit Sub Salah:
MsgBox Err.Description End Sub
Private Sub txtAngsuran_Change()
If Not IsNumeric(txtAngsuran) Then txtAngsuran = "" End Sub
Private Sub txtKet_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then
If txtKet = "" Then
MsgBox "Silahkan Lengkapi Data", vbInformation, "Info" txtKet.SetFocus Else txtPinjaman.Enabled = True txtPinjaman.SetFocus End If End If End Sub
Private Sub txtLama_Change()
If Not IsNumeric(txtLama) Then txtLama = "" End Sub
Private Sub txtLama_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then
If txtLama = "" Then
MsgBox "Silahkan Lengkapi Data", vbInformation, "Info" txtLama.SetFocus
Else
txtTotal.Text = Format(Val(Int(txtPinjaman.Text)) * 1, "#,##0")
txtAngsuran.Text = Format(Val(Int(txtTotal.Text)) / Val(Int(txtLama.Text)), "#,##0") dtMulai.Enabled = True
dtMulai.Value = Format(Now, "dd/mm/yyyy") dtMulai.SetFocus End If dtMulai.Enabled = True dtMulai.SetFocus End If End Sub
Private Sub txtnoanggota_KeyPress(KeyAscii As Integer) KeyAscii = Asc(UCase(Chr(KeyAscii)))
If KeyAscii = 13 Then If txtNoAnggota <> "" Then
Query "Select * from QSimpanan1 Where NoAnggota='" & txtNoAnggota.Text & "'" If oKoperasi.EOF Then
oKoperasi.Close Set oKoperasi = Nothing Fokus txtNoAnggota
MsgBox " No Anggota = " & txtNoAnggota & " Tidak terdaftar...", vbInformation Exit Sub
End If Daftar
oKoperasi.Close Set oKoperasi = Nothing
Query "Select * from tblPinjaman Where NoAnggota='" & txtNoAnggota.Text & "' And Status<>'" & xStatus & "'" If oKoperasi.EOF Then
oKoperasi.Close Set oKoperasi = Nothing txtSaldo.Enabled = True txtSaldo.SetFocus Exit Sub End If
MsgBox "No Anggota = " & txtNoAnggota & " " & Chr(10) & _ "Nama = " & txtNama.Text & " " & Chr(10) & _ "Belum Melunasi Uang Pinjaman...", vbCritical Fokus txtNoAnggota
txtNoAnggota = "": txtNama = "" txtAlamat = "": txtSaldo = "" oKoperasi.Close
Set oKoperasi = Nothing End If
End If End Sub
Private Sub txtOID_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then
If txtOID = "" Then
MsgBox "Silahkan Lengkapi Data", vbInformation, "Info" txtOID.SetFocus Else cmdSimpan.Enabled = True: cmdSimpan.SetFocus End If End If End Sub
Private Sub txtPinjaman_Change()
If Not IsNumeric(txtPinjaman) Then txtPinjaman = "" End Sub
Private Sub txtPinjaman_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then
If txtPinjaman > x1 Then
MsgBox "Jumlah pinjaman tidak boleh lebih dari kriteria pinjaman...!", vbExclamation, "error Input" txtPinjaman.SetFocus Else txtLama.Enabled = True txtLama.SetFocus txtPinjaman.Text = Format(txtPinjaman, "#,##0") End If End If End Sub
Private Sub txtsaldo_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then
Query "Select * from QSimpanan1 Where NoAnggota='" & txtNoAnggota.Text & "'" Daftar
If txtSaldo <= 500000 Then
MsgBox " No. Anggota Simpanan { " & txtNoAnggota.Text & " } belum memenuhi kriteria untuk melakukan pinjam...!", vbCritical
txtNoAnggota.SetFocus ElseIf txtSaldo <= 2000000 Then x = 5000000
x1 = 10000000
txtKet.Enabled = True txtKet.SetFocus
ElseIf txtSaldo <= 20000000 Then x = 5000000 x1 = 25000000 txtKet.Enabled = True txtKet.SetFocus x.Text = Format(x.Text, "#,##0") End If End If End Sub
7. Coding Form Angsuran Pinjaman Option Explicit
Dim xTotal As Currency Dim xSisa As Currency Dim xJumlah As Currency Const ket = "Lunas" Dim Kata As String Dim xTempo As Integer
Private Sub cmbPinjam_Click() If cmbPinjam.Text <> "" Then
Query "Select * from QBayar Where NoPinjam ='" & cmbPinjam.Text & "'" If oKoperasi.EOF Then
oKoperasi.Close Set oKoperasi = Nothing
Query "Select * from QPinjaman Where NoPinjam='" & cmbPinjam.Text & "'" If oKoperasi.EOF Then
oKoperasi.Close Set oKoperasi = Nothing
MsgBox " No.BA { " & cmbPinjam.Text & " } Tidak terdaftar...", vbCritical cmbPinjam.SetFocus Exit Sub End If With oKoperasi txtNama = !Nama txtAlamat = !Alamat dtPinjam = !TglPinjam txtLama = !Lama txtPinjam = Format(![PinjamanPokok], "#,##0") txtJumlah = Format(![TotalPinjaman], "#,##0") txtAngsuran = Format(!Angsuran, "#,##0") txtSisa = Format(![TotalPinjaman], "#,##0")
txtNoAnggota = !NoAnggota: dtTempo.Text = Format(!TglBayar, "dd") txtDenda = 0
.Close
dtBulan.Text = Format(Now, "mm") dtTahun.Text = Format(Now, "yyyy") End With
txtPriode.Text = 1 txtDenda = 0
txtBayar = Format(txtAngsuran, "#,##0")
xSisa = Format(Val(Int(txtSisa.Text)) - Val(Int(txtAngsuran.Text)), "#,##0") xTotal = txtAngsuran.Text
dtBayar.Enabled = True
dtBayar.Value = Format(Now, "dd/mm/yyyy") dtBayar.Enabled = True
dtBayar.SetFocus Exit Sub
End If Daftar
xTotal = Format(Val(Int(txtBayar.Text)) + Val(Int(txtAngsuran.Text)), "#,##0") xSisa = Format(Val(Int(txtSisa.Text)) - Val(Int(txtAngsuran.Text)), "#,##0") dtBayar.Enabled = True
oKoperasi.Close Set oKoperasi = Nothing
If Val(txtLama.Text) < Val(txtPriode.Text) Then
MsgBox " Pembayaran Angsuran Bernomor Anggota = " & txtNoAnggota & " Sudah Lunas...", vbInformation xUpdate Semula Exit Sub End If End If End Sub
Private Sub cmbPinjam_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then
If cmbPinjam.Text <> "" Then
Query "Select * from tblPinjaman Where NoPinjam='" & cmbPinjam.Text & "'" If oKoperasi.EOF Then
oKoperasi.Close Set oKoperasi = Nothing
MsgBox " No Pinjaman = " & cmbPinjam.Text & " Tidak Terdaftar...", vbCritical cmbPinjam.SetFocus Exit Sub End If Daftar dtBayar.SetFocus oKoperasi.Close Set oKoperasi = Nothing End If End If End Sub Sub Daftar() With oKoperasi txtNoAnggota = !NoAnggota txtNama = !Nama txtAlamat = !Alamat dtPinjam = !TglPinjam txtJenis = !Jenis
txtLama = !Lama: txtOID1 = !OID1
txtPinjam = Format(![PinjamanPokok], "#,##0") dtTempo.Text = Format(![TglBayar], "dd") txtJumlah = Format(![TotalPinjaman], "#,##0") txtAngsuran = Format(!Angsuran, "#,##0") txtPriode = !Jumlah + 1 txtSisa = Format(!JlhSisa, "#,##0") txtkredit = Format(!Kredit, "#,##0") xTotal = Format(!Total, "#,##0") txtBayar = Format(!Total, "#,##0") End With dtBulan.Text = Format(Now, "mm") dtTahun.Text = Format(Now, "yyyy") End Sub
Private Sub cmdCari_Click()
Kata = InputBox("Masukkan No.BA Pinjaman Yang akan dicari..", "Seacrh...") If Kata = "" Then Exit Sub
Set oKoperasi = Nothing
oKoperasi.Open "Select * from QBayar Where NoPinjam='" & Kata & "'", , adLockPessimistic If Not oKoperasi.EOF Then
With oKoperasi
cmbPinjam.Text = !NoPinjam:
txtNoAnggota = !NoAnggota: txtNama = !Nama txtAlamat = !Alamat
txtJenis = !Jenis: txtPinjam = Format(![PinjamanPokok], "#,##0") txtBayar.Text = Format(oKoperasi!Bayar, "#,##0")
txtAngsuran = Format(oKoperasi!Angsuran, "#,##0") txtLama = !Lama txtPriode = Format(oKoperasi!Periode, "#,##0") txtSisa = Format(oKoperasi!Sisa, "#,##0") xTotal = Format(oKoperasi!Total, "#,##0") .Close End With
Set oKoperasi = Nothing cmdHapus.Enabled = True cmdEdit.Enabled = False cmdTambah.Caption = "&Batal" Exit Sub End If oKoperasi.Close Set oKoperasi = Nothing
MsgBox " No Pinjaman [" & Kata & "] tidak terdaftar...", vbCritical End Sub
Private Sub cmdEdit_Click() blnEdit = True dtBayar.Enabled = True dtBayar.SetFocus cmdSimpan.Enabled = True cmdEdit.Enabled = False cmdHapus.Enabled = False cmdCari.Enabled = False End Sub
Private Sub cmdHapus_Click() On Error GoTo Salah
Kata = MsgBox("Anda Yakin Untuk Menghapus Data Angsuran vbCritical + vbYesNo)
If Kata = vbYes Then
cnKoperasi.Execute "Delete From tblBayar Where NoPinjam='" & cmbPinjam.Text & "'" MsgBox " Data Angsuran Pinjaman Telah Di Hapus...", vbInformation
Semula Exit Sub End If Exit Sub Salah:
MsgBox " Data Angsuran Tidak Dapat Di Hapus.." & Chr(10) & _ "Silahkan Periksa Angsuran Angoota...", vbCritical
End Sub
Private Sub cmdSimpan_Click() Me.MousePointer = 11 If Not blnEdit Then Save Else Edit End If Me.MousePointer = 1 End Sub Function Edit() On Error GoTo Salah
cnKoperasi.Execute "Update tblBayar Set Terlambat='" & _
txtterlambat.Text & "',Denda='" & txtDenda.Text & "' Where NoPinjam cnKoperasi.Execute "Update " Semula Exit Function Salah: MsgBox Err.Description End Function
Sub xUpdate() If xLunas Then
cnKoperasi.Execute "Update tblPinjaman Set Status ='" & ket & "' Where NoPinjam='" & cmbPinjam.Text & "'" End If
End Sub
Function Save() On Error GoTo Salah Me.MousePointer = 11
cnKoperasi.Execute "Insert Into tblBayar Values ('" & txtNomor.Text & "'," & _
"'" & dtBukti.Value & "','" & cmbPinjam.Text & "','" & txtJenis.Text & "','" & txtBayar.Text & "'," & _ "'" & txttbunga.Text & "'," & _
"'" & xSisa & "','" & txtPriode.Text & "','" & txtkredit.Text & "','" & xTotal & "'," & _ "'" & xSisa & "','" & txtterlambat.Text & " ','" & txtDenda.Text & "'," & _
"'" & txtPriode.Text & "','" & txtOID1.Text & " ')"
cnKoperasi.Execute "Update tblBayar Set Total='" & xTotal & "',JlhSisa='" & xSisa txtPriode.Text & "' Where NoPinjam='" & cmbPinjam.Text & "'"
xUpdate Semula
Me.MousePointer = 1 Exit Function Salah:
MsgBox Err.Description & Err.Number Me.MousePointer = 1
End Function
Private Sub cmdTambah_Click()
If cmdTambah.Caption = "&Tambah" Then cmdTambah.Caption = "&Batal" GetNumber
dtBukti.Enabled = True
dtBayar.Value = Format(Now, "dd/mm/yyyy") dtBukti.Value = Format(Now, "dd/mm/yyyy") dtBukti.SetFocus DaftarPinjam Else Semula End If End Sub Sub GetNumber() On Error GoTo Salah Dim Counter As String * 11 Dim Hitung As Integer Dim Tgl As String
Query "Select * from tblBayar order By [NoBukti]" Tgl = Format(Now, "dd/mm/yyyy")
With oKoperasi
If .RecordCount = 0 Then
Counter = "NB-" + Right(Tgl, 2) + Mid(Tgl, 4, 2) Else
.MoveLast
If Left(![NoBukti], 7) <> "NB-" + Right(Tgl, 2) + Mid(Tgl, 4, 2) Counter = "NB-" + Right(Tgl, 2) + Mid(Tgl, 4, 2) + "001" Else
Hitung = Val(Right(!NoBukti, 4)) + 1 + 1 - 1 Counter = "NB-" + Right(Tgl, 2) + Mid(Tgl, 4, 2 End If End If txtNomor.Enabled = True txtNomor.Text = Counter End With Exit Sub
Salah:
MsgBox Err.Description End Sub
Sub DaftarPinjam() Me.MousePointer = 11
Query "Select * from tblPinjaman Where cmbPinjam.Clear
If Not oKoperasi.EOF Then oKoperasi.MoveFirst Do While Not oKoperasi.EOF
cmbPinjam.AddItem oKoperasi!NoPinjam oKoperasi.MoveNext
Loop End If
oKoperasi.Close Set oKoperasi = Nothing Me.MousePointer = 1 End Sub
Function xLunas() As Boolean xLunas = False
If Val(txtLama) <= Val(txtPriode) Then xLunas = True Else xLunas = False End If End Function Function Semula() ClearControl Me cmdSimpan.Enabled = False cmdCari.Enabled = True cmdTambah.Caption = "&Tambah" cmdTambah.SetFocus blnEdit = False End Function
Private Sub cmdTutup_Click() Unload Me
End Sub
Private Sub dtBayar_KeyDown(KeyCode As Integer, Shift Asr) If KeyCode = 13 Then
xTempo = Day(dtBayar.Value) txtterlambat.Text = xTempo - dtTempo txtbunga.Enabled = True
Fokus txtbunga End If
End Sub
Private Sub dtBukti_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then
cmbPinjam.Enabled = True cmbPinjam.SetFocus End If
End Sub
Private Sub Form_Load() Ketengah Me
Call bangsat End Sub
txtNomor.Enabled = False dtBukti.Enabled = False cmbPinjam.Enabled = False dtPinjam.Enabled = False txtNoAnggota.Enabled = False txtNama.Enabled = False txtAlamat.Enabled = False txtPinjam.Enabled = False txtLama.Enabled = False dtTempo.Enabled = False dtBulan.Enabled = False dtTahun.Enabled = False dtBayar.Enabled = False txtJumlah.Enabled = False txtBayar.Enabled = False txtSisa.Enabled = False txtbunga.Enabled = False txttbunga.Enabled = False txtAngsuran.Enabled = False txtkredit.Enabled = False txtterlambat.Enabled = False txtDenda.Enabled = False txtPriode.Enabled = False txtTotal.Enabled = False txtJenis.Enabled = False txtOID1.Enabled = False End Sub
Private Sub txtbunga_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then
If txtbunga = "" Then
MsgBox "Silahkan Lengkapi Data", vbInformation, "Info" txtbunga.SetFocus
txtDenda.Text = 0 Else
txttbunga.Text = Format(Val(Int(txtSisa.Text)) * Val(txtbunga.Text) txtDenda.Text = Format(txtDenda, "#,##0")
txttbunga.Text = Format(txttbunga, "#,##0") txtkredit.Text = Format(txtkredit, "#,##0") txtkredit.Text = 0
txtDenda.Text = Format(Val(Int(txtterlambat.Text)) * (1000), "#,##0") txtTotal.Text = Format(Val(Int(txtAngsuran.Text)) + Val(Int(txttbunga.Text)). txttbunga.Enabled = False txtJenis.Enabled = True txtJenis.SetFocus cmdEdit.Enabled = False cmdHapus.Enabled = False cmdSimpan.Enabled = False End If End If End Sub
Private Sub txtJenis_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then
If txtJenis = "" Then
MsgBox "Silahkan Lengkapi Data", txtJenis.SetFocus Else txtOID1.Enabled = True: txtOID1.SetFocus End If End If End Sub
Private Sub txtNama_Change()
If IsNumeric(txtNama) Then txtNama = "" End Sub
Private Sub txtOID1_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then
If txtOID1 = "" Then
MsgBox "Silahkan Lengkapi Data", txtOID1.SetFocus Else cmdSimpan.Enabled = True: cmdSimpan.SetFocus End If End If End Sub
8. Coding Form Tentang Dim ket As String
Private Sub Command1_Click() Unload Me
End Sub
Private Sub Form_Activate() ket = " " & a1.Caption End Sub
Private Sub Timer1_Timer()
ket = Right(ket, Len(ket) - 1) & Left(ket, 1) a1.Caption = ket