0% found this document useful (0 votes)
12 views

Listing Program: Universitas Sumatera Utara

The document contains code for a menu listing program for a cooperative management information system. It includes code for menu items such as login, creating new user IDs, member biodata, loans, and the main menu. The code establishes connections to a database and performs actions like adding, deleting, and updating records when menu items are clicked.

Uploaded by

Haqsari Rizqi
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

Listing Program: Universitas Sumatera Utara

The document contains code for a menu listing program for a cooperative management information system. It includes code for menu items such as login, creating new user IDs, member biodata, loans, and the main menu. The code establishes connections to a database and performs actions like adding, deleting, and updating records when menu items are clicked.

Uploaded by

Haqsari Rizqi
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

LISTING PROGRAM

1. Menu Utama Private Sub Command1_Click() Frm_Login2.Show End Sub Private Sub Command2_Click() Unload Me End Sub Private Sub Form_Load() Label1.Caption = "Sistem Informasi Manajemen Koperasi Simpan Pinjam Karyawan " Label2.Caption = "Pertamina (Persero) Unit Pemasaran I Medan" Timer1.Interval = "3" End Sub Private Sub Timer1_Timer() Label1.Left = Label1.Left - 40 Label2.Left = Label2.Left - 40 If Label1.Left < -12000 Then Label1.Left = 10000 If Label2.Left < -10000 Then Label2.Left = 12000 End If End If End Sub

2. Menu Login Private Sub Cmd_Cancel_Click() Unload Me End Sub Private Sub Cmd_masuk_Click() Adodc1.ConnectionString = "Provider = Microsoft.JET.OLEDB.4.0;Data Source = " + App.Path + "\db_koperasi.mdb" Adodc1.RecordSource = "select * from tb_login where Password = '" & txtPassword.Text & "'" Adodc1.Refresh If Adodc1.Recordset.EOF Then txtPassword = "" Adodc1.RecordSource = "select * from tb_login" Adodc1.Recordset.Requery MsgBox " Maaf Password yang anda masukkan salah ", vbCritical Else

Universitas Sumatera Utara

txtPassword.Text = Adodc1.Recordset!Password Form_menu.Show End If End Sub Private Sub Cmd_UserBaru_Click() Form_login1.Show End Sub Private Sub Form_Activate() Adodc2.ConnectionString = "Provider = Microsoft.JET.OLEDB.4.0;Data Source = " + App.Path + "\db_koperasi.mdb" Adodc2.RecordSource = "select * from tb_login" Adodc1.Refresh Do While Not Adodc1.Recordset.EOF Combo1.AddItem Adodc1.Recordset!User_Name Adodc1.Recordset.MoveNext Loop End Sub Private Sub Form_Load() Adodc1.ConnectionString = "Provider =Microsoft.JET.OLEDB.4.0;Data Source = " + App.Path + "\db_koperasi.mdb" Adodc1.RecordSource = "tb_login" Adodc1.Refresh Adodc1.Visible = False Adodc2.Visible = False End Sub Private Sub txtPassword_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then Command1.SetFocus End If End Sub

3. Buat User ID Baru Private Sub cmdhapus_Click() Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + App.Path + "\db_koperasi.mdb" Adodc1.RecordSource = "select * from tb_login" Adodc1.Refresh If Adodc1.Recordset.EOF Then MsgBox "Data tidak ada" Else Adodc1.Recordset.Delete Adodc1.RecordSource = "select * from tb_login" Adodc1.Recordset.Requery Adodc1.Refresh End If

Universitas Sumatera Utara

txtNama.Text = "" txtPassword.Text = "" txtNama.SetFocus End Sub Private Sub cmdkeluar_Click() Unload Me End Sub Private Sub cmdsimpan_Click() Adodc1.ConnectionString = "Provider = Microsoft.JET.OLEDB.4.0;Data Source = " + App.Path + "\db_koperasi.mdb" Adodc1.RecordSource = "select * from tb_login" Adodc1.Refresh Adodc1.RecordSource = "select * from tb_login" Adodc1.Recordset.Requery Adodc1.Refresh Adodc1.Recordset.AddNew Adodc1.Recordset!User_Name = txtNama.Text Adodc1.Recordset!Password = txtPassword.Text Adodc1.Recordset.Update Adodc1.RecordSource = "Select * from tb_login" Adodc1.Recordset.Requery Adodc1.Refresh txtNama.Text = "" txtPassword.Text = "" txtNama.SetFocus End Sub Private Sub Form_Load() Adodc1.ConnectionString = "Provider = Microsoft.JET.OLEDB.4.0;Data Source = " + App.Path + "\db_koperasi.mdb" Adodc1.RecordSource = "select * from tb_login" Adodc1.Refresh Set DataGrid1.DataSource = Adodc1 Adodc1.Visible = False Set DataGrid1.DataSource = Adodc1 Adodc1.Visible = False End Sub

Universitas Sumatera Utara

4. Menu Utama

Private Sub mn_Anggota_Click() Form_anggota.Show End Sub Private Sub mn_dafbayar_Click() Form_cetakpembayaran.Show End Sub Private Sub mn_dafsimpan_Click() Form_cetaksimpanan.Show End Sub Private Sub mn_lapanggota_Click() Form_LaporanAnggota.Show End Sub Private Sub mn_lapByr_Click() Form_LaporanPembayaran.Show End Sub Private Sub mn_lapPinj_Click() Form_LaporanPinjaman.Show End Sub Private Sub mn_lapSimp_Click() Form_LaporanSimpanan.Show End Sub Private Sub mn_pembayaran_Click() Form_pembayaran.Show End Sub Private Sub mn_pertamina_Click() Form_Sejarah.Show End Sub Private Sub mn_Pinjaman_Click() Form_pinjaman.Show End Sub Private Sub mn_profil_Click() Form_profil.Show End Sub Private Sub mn_quit_Click() End End Sub Private Sub mn_Simpanan_Click() Form_simpanan.Show End Sub Private Sub mn_visi_Click()

Universitas Sumatera Utara

Form_visi.Show End Sub Private Sub Toolbar2_ButtonClick(ByVal Button As MSComctlLib.Button) Select Case Button.Key Case "F1" Form_anggota.Show Case "F3" Form_simpanan.Show Case "F4" Form_pinjaman.Show Case "F5" Form_pembayaran.Show Case "F9" End End Select End Sub Private Sub Toolbar2_ButtonDropDown(ByVal Button As MSComctlLib.Button) Select Case Button.Key Case "F7" PopupMenu mn_Laporan, 4 End Select End Sub

a. Menu File 1. Biodata Anggota

Private Sub cboAg_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then txtGol.SetFocus End If End Sub Private Sub Combo5_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then txtTelp.SetFocus End If End Sub Private Sub Combo6_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then cboAg.SetFocus End If End Sub Private Sub Combo7_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then

Universitas Sumatera Utara

cboAg.SetFocus End If End Sub Private Sub Form_Load() Adodc1.ConnectionString = "Provider = Microsoft.JET.OLEDB.4.0;Data Source = " + App.Path + "\db_koperasi.mdb" Adodc1.RecordSource = "select * from tb_anggota order by nmr_anggota" Adodc1.Refresh Set DataGrid1.DataSource = Adodc1 Adodc1.Visible = False For i = 1 To 31 Combo1.AddItem i Next i For i = 1920 To 2030 Combo3.AddItem i Next i For i = 1 To 12 Combo2.AddItem i Next i End Sub Private Sub Text1_Change() Adodc1.ConnectionString = "Provider = Microsoft.JET.OLEDB.4.0;Data Source = " + App.Path + "\db_koperasi.mdb" Adodc1.RecordSource = "select * from tb_anggota where nmr_anggota = '" & Text1.Text & "'" Adodc1.Refresh If Adodc1.Recordset.EOF Then txtNama.Text = "" txtAlamat.Text = "" txtTmpt.Text = "" cboAg = "" Combo6 = "" Combo7 = "" txtGol.Text = "" txtTelp.Text = "" Combo1 = "" Combo2 = "" Combo3 = "" Combo5 = " " Text1.SetFocus Adodc1.RecordSource = "select * from tb_anggota order by nmr_anggota" Adodc1.Recordset.Requery Adodc1.Refresh Else txtNama.Text = Adodc1.Recordset!nama txtAlamat.Text = Adodc1.Recordset!alamat txtTmpt.Text = Adodc1.Recordset!tmpt_lahir cboAg = Adodc1.Recordset!agama Combo6 = Adodc1.Recordset!j_kelamin

Universitas Sumatera Utara

Combo7 = Adodc1.Recordset!golongan txtGol.Text = Adodc1.Recordset!jabatan txtTelp.Text = Adodc1.Recordset!no_telp Combo1 = Adodc1.Recordset!tgl_lahir Combo2 = Adodc1.Recordset!bln_lahir Combo3 = Adodc1.Recordset!thn_lahir Combo5 = Adodc1.Recordset!ket_status End If End Sub Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button) Select Case Button.Key Case "F1" Adodc1.ConnectionString = "Provider = Microsoft.JET.OLEDB.4.0;Data Source = " + App.Path + "\db_koperasi.mdb" Adodc1.RecordSource = "select * from tb_anggota order by nmr_anggota" Adodc1.Refresh Adodc1.RecordSource = "select * from tb_anggota order by nmr_anggota " Adodc1.Recordset.Requery Adodc1.Refresh Adodc1.Recordset.AddNew Adodc1.Recordset!nmr_anggota = Text1.Text Adodc1.Recordset!nama = txtNama.Text Adodc1.Recordset!alamat = txtAlamat.Text Adodc1.Recordset!tmpt_lahir = txtTmpt.Text Adodc1.Recordset!j_kelamin = Combo6.Text Adodc1.Recordset!ket_status = Combo5.Text Adodc1.Recordset!no_telp = txtTelp.Text Adodc1.Recordset!agama = cboAg.Text Adodc1.Recordset!jabatan = txtGol.Text Adodc1.Recordset!tgl_lahir = Combo1.Text Adodc1.Recordset!bln_lahir = Combo2.Text Adodc1.Recordset!thn_lahir = Combo3.Text Adodc1.Recordset!golongan = Combo7.Text Adodc1.Recordset.Update Adodc1.RecordSource = "Select * from tb_anggota order by nmr_anggota " Adodc1.Recordset.Requery Adodc1.Refresh MsgBox " Data berhasil di simpan ", vbInformation Text1.Text = "" txtNama.Text = "" txtTmpt.Text = "" Combo6.Text = "" Combo5.Text = "" txtTelp.Text = "" cboAg.Text = "" Combo7.Text = "" txtGol.Text = "" txtAlamat.Text = ""

Universitas Sumatera Utara

Combo1.Text = "Tanggal :" Combo2.Text = "Bulan :" Combo3.Text = "Tahun :" Text1.SetFocus Case "F3" Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + App.Path + "\db_koperasi.mdb" Adodc1.RecordSource = "select * from tb_anggota" Adodc1.Refresh If Adodc1.Recordset.EOF Then MsgBox "Data tidak ada" Else Adodc1.Recordset.Delete Adodc1.RecordSource = "select * from tb_anggota" Adodc1.Recordset.Requery Adodc1.Refresh End If Text1.Text = "" txtNama.Text = "" txtTmpt.Text = "" Combo6.Text = "" Combo5.Text = "" txtTelp.Text = "" Combo7.Text = "" cboAg.Text = "" txtGol.Text = "" txtAlamat.Text = "" Text1.SetFocus Case "F5" Adodc1.ConnectionString = "Provider = Microsoft.JET.OLEDB.4.0;Data Source = " + App.Path + "\db_koperasi.mdb" Adodc1.RecordSource = "select * from tb_anggota order by no_anggota" DataGrid1.EditActive = True Case "F7" Unload Me End Select End Sub Private Sub txtAlamat_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then txtTmpt.SetFocus End If End Sub Private Sub txtNama_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then txtAlamat.SetFocus End If End Sub

Universitas Sumatera Utara

Private Sub txtTmpt_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then Combo6.SetFocus End If End Sub

b. Menu Transaksi 1. Peminjaman

Private Sub Form_Load() Adodc1.ConnectionString = "Provider = Microsoft.JET.OLEDB.4.0;Data Source = " + App.Path + "\db_koperasi.mdb" Adodc1.RecordSource = "select * from tb_pinjaman" Adodc1.Refresh Set DataGrid1.DataSource = Adodc1 Adodc1.Visible = False For i = 1 To 60 Combo1.AddItem i Next i End Sub Private Sub Text1_GotFocus() Text1.Text = Val(txtPinjaman.Text) + Val(txtBunga.Text) + Val(txtAdmin.Text) End Sub Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button) Select Case Button.Key Case "F1" Adodc1.ConnectionString = "Provider = Microsoft.JET.OLEDB.4.0;Data Source = " + App.Path + "\db_koperasi.mdb" Adodc1.RecordSource = "select * from tb_pinjaman" Adodc1.Refresh Adodc1.RecordSource = "select * from tb_pinjaman " Adodc1.Recordset.Requery Adodc1.Refresh Adodc1.Recordset.AddNew Adodc1.Recordset!no_pinjam = txtNomor.Text Adodc1.Recordset!tgl_pinjam = DTPicker1 Adodc1.Recordset!no_anggota = txtNoAnggota.Text Adodc1.Recordset!nama = txtNama.Text Adodc1.Recordset!alamat = txtAlamat.Text Adodc1.Recordset!jabatan = txtPekerjaan.Text Adodc1.Recordset!pinjaman_pokok = txtPinjaman.Text Adodc1.Recordset!jangka_waktu = Combo1.Text Adodc1.Recordset!jangka_waktu = Combo1.Text

Universitas Sumatera Utara

Adodc1.Recordset!bunga = txtBunga.Text Adodc1.Recordset!admin = txtAdmin.Text Adodc1.Recordset!tgl_mulai = DTPicker2 Adodc1.Recordset!tgl_selesai = DTPicker3 Adodc1.Recordset!total_pinjaman = Text1.Text Adodc1.Recordset!cicilan = txtcicil.Text Adodc1.Recordset!golongan = Combo2.Text Adodc1.Recordset.Update Adodc1.RecordSource = "Select * from tb_pinjaman " Adodc1.Recordset.Requery Adodc1.Refresh MsgBox " Data berhasil di simpan ", vbInformation txtNomor = "" DTPicker1.Refresh txtanggota = "" txtNama = "" txtAlamat = "" txtPekerjaan = "" txtPinjaman = "" Combo1 = "" Combo2 = "" txtBunga = "" Text1 = "" txtcicil = "" DTPicker2.Refresh DTPicker3.Refresh txtAdmin = "" txtNomor.SetFocus Case "F3" Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + App.Path + "\db_koperasi.mdb" Adodc1.RecordSource = "select * from tb_pinjaman" Adodc1.Refresh If Adodc1.Recordset.EOF Then MsgBox "Data tidak ada" Else Adodc1.Recordset.Delete Adodc1.RecordSource = "select * from tb_pinjaman" Adodc1.Recordset.Requery Adodc1.Refresh End If txtNomor = "" DTPicker1.Refresh txtanggota = "" txtNama = "" txtAlamat = "" txtPekerjaan = "" txtPinjaman = "" Combo1 = "" Combo2 = "" txtBunga = "" Text1 = "" txtcicil = ""

Universitas Sumatera Utara

DTPicker2.Refresh DTPicker3.Refresh txtAdmin = "" txtNomor.SetFocus Case "F5" Unload Me End Select End Sub Private Sub txtadmin_GotFocus() txtAdmin = Val(txtPinjaman.Text) * 0.01 End Sub Private Sub txtbunga_GotFocus() txtBunga = Val(Combo1.Text) * Val(txtPinjaman.Text) * 0.01 End Sub Private Sub txtcicil_GotFocus() txtcicil = Val(Text1.Text) / Val(Combo1.Text) End Sub Private Sub txtNoAnggota_Change() Adodc1.ConnectionString = "Provider = Microsoft.JET.OLEDB.4.0;Data Source = " + App.Path + "\db_koperasi.mdb" Adodc1.RecordSource = "select * from tb_anggota where nmr_anggota = '" & txtNoAnggota.Text & "'" Adodc1.Refresh If Adodc1.Recordset.EOF Then txtNama.Text = "" txtAlamat.Text = "" txtPekerjaan.Text = "" Combo2 = "" txtNoAnggota.SetFocus Adodc1.RecordSource = "select * from tb_anggota order by nmr_anggota" Adodc1.Recordset.Requery Adodc1.Refresh Else txtNama.Text = Adodc1.Recordset!nama txtAlamat.Text = Adodc1.Recordset!alamat txtPekerjaan.Text = Adodc1.Recordset!jabatan Combo2 = Adodc1.Recordset!golongan End If End Sub

Universitas Sumatera Utara

2. Simpanan Private Sub Form_Load() Adodc1.ConnectionString = "Provider = Microsoft.JET.OLEDB.4.0;Data Source = " + App.Path + "\db_koperasi.mdb" Adodc1.RecordSource = "select * from tb_simpanan order by no_bukti" Adodc1.Refresh Set DataGrid1.DataSource = Adodc1 Adodc1.Visible = False DTPicker1.Value = Date End Sub Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button) Select Case Button.Key Case "F1" Adodc1.ConnectionString = "Provider = Microsoft.JET.OLEDB.4.0;Data Source = " + App.Path + "\db_koperasi.mdb" Adodc1.RecordSource = "select * from tb_simpanan order by no_bukti" Adodc1.Refresh Adodc1.RecordSource = "select * from tb_simpanan order by no_bukti " Adodc1.Recordset.Requery Adodc1.Refresh Adodc1.Recordset.AddNew Adodc1.Recordset!no_bukti = txtNomor.Text Adodc1.Recordset!tgl_simpanan = DTPicker1 Adodc1.Recordset!no_anggota = txtNoAnggota.Text Adodc1.Recordset!nama = txtNama.Text Adodc1.Recordset!alamat = txtAlamat.Text Adodc1.Recordset!jabatan = txtPekerjaan.Text Adodc1.Recordset!golongan = Combo1.Text Adodc1.Recordset!simpanan = txtdebet.Text Adodc1.Recordset!jumlah_simpanan = txtSaldo.Text Adodc1.Recordset.Update Adodc1.RecordSource = "Select * from tb_simpanan order by no_bukti " Adodc1.Recordset.Requery Adodc1.Refresh MsgBox " Data berhasil di simpan ", vbInformation txtNomor.Text = "" DTPicker1.Refresh txtNoAnggota.Text = "" txtNama.Text = "" txtAlamat.Text = "" txtPekerjaan.Text = "" txtdebet.Text = "" Combo1.Text = "" txtSaldo.Text = "" txtNomor.SetFocus

Universitas Sumatera Utara

Case "F3" Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + App.Path + "\db_koperasi.mdb" Adodc1.RecordSource = "select * from tb_simpanan" Adodc1.Refresh If Adodc1.Recordset.EOF Then MsgBox "Data tidak ada" Else Adodc1.Recordset.Delete Adodc1.RecordSource = "select * from tb_simpanan" Adodc1.Recordset.Requery Adodc1.Refresh End If txtNomor.Text = "" DTPicker1.Refresh txtNoAnggota.Text = "" txtNama.Text = "" txtAlamat.Text = "" txtPekerjaan.Text = "" txtdebet.Text = "" Combo1.Text = "" txtSaldo.Text = "" txtNomor.SetFocus Case "F5" Unload Me End Select End Sub Private Sub txtdebet_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then txtSaldo.SetFocus End If End Sub Private Sub txtNoAnggota_Change() Adodc1.ConnectionString = "Provider = Microsoft.JET.OLEDB.4.0;Data Source = " + App.Path + "\db_koperasi.mdb" Adodc1.RecordSource = "select * from tb_anggota where nmr_anggota = '" & txtNoAnggota.Text & "'" Adodc1.Refresh If Adodc1.Recordset.EOF Then txtNama.Text = "" txtAlamat.Text = "" txtPekerjaan.Text = "" Combo1 = "" txtNoAnggota.SetFocus Adodc1.RecordSource = "select * from tb_anggota order by nmr_anggota" Adodc1.Recordset.Requery Adodc1.Refresh Else txtNama.Text = Adodc1.Recordset!nama

Universitas Sumatera Utara

txtAlamat.Text = Adodc1.Recordset!alamat txtPekerjaan.Text = Adodc1.Recordset!jabatan Combo1 = Adodc1.Recordset!golongan End If End Sub Private Sub txtNomor_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then txtNoAnggota.SetFocus End If End Sub Private Sub txtSaldo_GotFocus() txtSaldo = Val(txtdebet) End Sub

3. Pembayaran Private Sub Text1_Change() Adodc1.ConnectionString = "Provider = Microsoft.JET.OLEDB.4.0;Data Source = " + App.Path + "\db_koperasi.mdb" Adodc1.RecordSource = "select * from tb_pinjaman where no_pinjam = '" & Text1.Text & "'" Adodc1.Refresh If Adodc1.Recordset.EOF Then txtNoAnggota.Text = "" txtNama.Text = "" txtAlamat.Text = "" txtPekerjaan.Text = "" Combo4 = "" Combo1 = "" txtPinjam.Text = "" txtbunga.Text = "" txtadmin.Text = "" txtJumlah.Text = "" Text1.SetFocus Adodc1.RecordSource = "select * from tb_pinjaman order by no_pinjam" Adodc1.Recordset.Requery Adodc1.Refresh Else txtNoAnggota.Text = Adodc1.Recordset!no_anggota txtNama.Text = Adodc1.Recordset!nama txtAlamat.Text = Adodc1.Recordset!alamat txtPekerjaan.Text = Adodc1.Recordset!jabatan Combo4 = Adodc1.Recordset!golongan Combo1 = Adodc1.Recordset!jangka_waktu txtPinjam.Text = Adodc1.Recordset!pinjaman_pokok txtbunga.Text = Adodc1.Recordset!bunga txtadmin.Text = Adodc1.Recordset!admin txtJumlah.Text = Adodc1.Recordset!total_pinjaman

Universitas Sumatera Utara

End If End Sub Private Sub Form_Load() Adodc1.ConnectionString = "Provider = Microsoft.JET.OLEDB.4.0;Data Source = " + App.Path + "\db_koperasi.mdb" Adodc1.RecordSource = "select * from tb_pembayaran" Adodc1.Refresh Set DataGrid1.DataSource = Adodc1 Adodc1.Visible = False For i = 1 To 60 Combo1.AddItem i Next i For i = 1 To 60 Combo2.AddItem i Next i DTPicker1.Value DTPicker2.Value DTPicker3.Value DTPicker4.Value End Sub = = = = Date Date Date Date

Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button) Select Case Button.Key Case "F1" Adodc1.ConnectionString = "Provider = Microsoft.JET.OLEDB.4.0;Data Source = " + App.Path + "\db_koperasi.mdb" Adodc1.RecordSource = "select * from tb_pembayaran order by no_pinjam" Adodc1.Refresh Adodc1.RecordSource = "select * from tb_pembayaran order by no_pinjam " Adodc1.Recordset.Requery Adodc1.Refresh Adodc1.Recordset.AddNew Adodc1.Recordset!no_pinjam = Text1.Text Adodc1.Recordset!tgl_pinjaman = DTPicker3 Adodc1.Recordset!no_anggota = txtNoAnggota.Text Adodc1.Recordset!nama = txtNama.Text Adodc1.Recordset!alamat = txtAlamat.Text Adodc1.Recordset!jabatan = txtPekerjaan.Text Adodc1.Recordset!pinjmn_pokok = txtPinjam.Text Adodc1.Recordset!lama_angsur = Combo1.Text Adodc1.Recordset!tgl_tempo = DTPicker1 Adodc1.Recordset!no_bukti = txtNomor.Text Adodc1.Recordset!tgl_bukti = DTPicker4 Adodc1.Recordset!tgl_byr = DTPicker2 Adodc1.Recordset!angsur_ke = txtPriode.Text Adodc1.Recordset!jlh_pnjmn = txtJumlah.Text

Universitas Sumatera Utara

Adodc1.Recordset!sdh_byar = txtBayar.Text Adodc1.Recordset!sisa = txtSisa.Text Adodc1.Recordset!angsuran = txtAngsuran.Text Adodc1.Recordset!terlambat = Combo2.Text Adodc1.Recordset!golongan = Combo4.Text Adodc1.Recordset!denda = txtDenda.Text Adodc1.Recordset!bunga = txtbunga.Text Adodc1.Recordset!admin = txtadmin.Text Adodc1.Recordset!total = txtTotal.Text Adodc1.Recordset.Update Adodc1.RecordSource = "Select * from tb_pembayaran order by no_pinjam " Adodc1.Recordset.Requery Adodc1.Refresh MsgBox " Data berhasil di simpan ", vbInformation Text1.Text = "" DTPicker3.Refresh txtNoAnggota = "" txtNama = "" txtAlamat = "" txtPekerjaan = "" txtPinjam = "" Combo1 = "" DTPicker1.Refresh txtNomor = "" DTPicker4.Refresh DTPicker2.Refresh txtPriode = "" txtJumlah = "" txtBayar = "" txtSisa = "" txtAngsuran = "" Combo2 = "" Combo4 = "" txtDenda = "" txtbunga = "" txtadmin = "" txtTotal = "" Text1.SetFocus Case "F3" Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + App.Path + "\db_koperasi.mdb" Adodc1.RecordSource = "select * from tb_pembayaran" Adodc1.Refresh If Adodc1.Recordset.EOF Then MsgBox "Data tidak ada" Else Adodc1.Recordset.Delete Adodc1.RecordSource = "select * from tb_pembayaran" Adodc1.Recordset.Requery Adodc1.Refresh End If Text1.Text = ""

Universitas Sumatera Utara

DTPicker3.Refresh txtNoAnggota = "" txtNama = "" txtAlamat = "" txtPekerjaan = "" txtPinjam = "" Combo1 = "" Combo4 = "" DTPicker1.Refresh txtNomor = "" DTPicker4.Refresh DTPicker2.Refresh txtPriode = "" txtJumlah = "" txtBayar = "" txtSisa = "" txtAngsuran = "" Combo2 = "" txtDenda = "" txtbunga = "" txtadmin = "" txtTotal = "" Text1.SetFocus Case "F5" Unload Me Case "F7" Form_LaporanPembayaran.Show End Select End Sub Private Sub txtadmin_GotFocus() txtadmin = Val(txtPinjam.Text) * 0.01 End Sub Private Sub txtadmin_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then txtJumlah.SetFocus End If End Sub Private Sub txtAlamat_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then txtPekerjaan.SetFocus End If End Sub Private Sub txtAngsuran_GotFocus() txtAngsuran = Val(txtJumlah.Text) / Val(Combo1.Text) End Sub Private Sub txtAngsuran_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then txtterlambat.SetFocus

Universitas Sumatera Utara

End If End Sub Private Sub txtBayar_GotFocus() txtBayar = Val(txtPriode.Text) * Val(txtAngsuran.Text) End Sub Private Sub txtBayar_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then txtSisa.SetFocus End If End Sub Private Sub txtbunga_GotFocus() txtbunga = Val(txtPinjam.Text) * Val(Combo1.Text) * 0.01 End Sub Private Sub txtbunga_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then txtadmin.SetFocus End If End Sub Private Sub txtDenda_GotFocus() txtDenda = Val(txtAngsuran.Text) * Combo2 * 0.01 End Sub Private Sub txtDenda_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then txtTotal.SetFocus End If End Sub Private Sub txtJumlah_GotFocus() txtJumlah = Val(txtPinjam.Text) + Val(txtbunga.Text) + Val(txtadmin.Text) End Sub Private Sub txtJumlah_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then txtBayar.SetFocus End If End Sub Private Sub txtNama_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then txtAlamat.SetFocus End If End Sub Private Sub txtNoAnggota_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then txtNama.SetFocus End If End Sub

Universitas Sumatera Utara

Private Sub txtPinjam_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then txtLama.SetFocus End If End Sub Private Sub txtPriode_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then txtJumlah.SetFocus End If End Sub Private Sub txtterlambat_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then txtDenda.SetFocus End If End Sub Private Sub txtSisa_GotFocus() txtSisa = Val(txtJumlah.Text) - Val(txtBayar.Text) End Sub Private Sub txtTotal_GotFocus() txtTotal = Val(txtAngsuran.Text) + Val(txtDenda.Text) End Sub

c. Laporan khusus 1. Laporan Simpanan Private Sub cmdCetak_Click() If Len(Combo1) Then lap_simpan.SelectionFormula = "{tb_simpanan.no_anggota}='" & Combo1.Text & "'" lap_simpan.RetrieveDataFiles lap_simpan.WindowState = crptMaximized lap_simpan.Action = 1 End If End Sub Private Sub Command2_Click() Unload Me Form_menu.Show End Sub Private Sub Form_Load() With Combo1 .AddItem ("1") .AddItem ("2") .AddItem ("3") .AddItem ("4") .AddItem ("5") .AddItem ("6")

Universitas Sumatera Utara

.AddItem .AddItem .AddItem .AddItem .AddItem .AddItem .AddItem .AddItem .AddItem End With End Sub

("7") ("8") ("9") ("10") ("11") ("12") ("13") ("14") ("15")

2. Laporan Pembayaran Private Sub Command1_Click() If Len(Combo1) Then Lap_bayar.SelectionFormula = "{tb_pembayaran.no_anggota}='" & Combo1.Text & "'" Lap_bayar.RetrieveDataFiles Lap_bayar.WindowState = crptMaximized Lap_bayar.Action = 1 End If End Sub Private Sub Command2_Click() Unload Me Form_menu.Show End Sub Private Sub Form_Load() With Combo1 .AddItem ("1") .AddItem ("2") .AddItem ("3") .AddItem ("4") .AddItem ("5") .AddItem ("6") .AddItem ("7") .AddItem ("8") .AddItem ("9") .AddItem ("10") .AddItem ("11") .AddItem ("12") End With End Sub

Universitas Sumatera Utara

d. About 1. Visi dan misi Private Sub Command1_Click() Unload Me End Sub Private Sub Timer1_Timer() If imgJdl.Top > (Picture1.ScaleHeight - imgJdl.Height) Then imgJdl.Top = imgJdl.Top - 20 Else For i = 1 To 4500000 Next i imgJdl.Top = Picture1.ScaleHeight End If End Sub

2. Profil Penulis Private Sub Command1_Click() Form_menu.Show End Sub Private Sub Timer1_Timer() If Image1.Top > (Picture1.ScaleHeight - Image1.Height) Then Image1.Top = Image1.Top - 20 Else For i = 1 To 4500000 Next i Image1.Top = Picture1.ScaleHeight End If End Sub

Universitas Sumatera Utara

You might also like