Data Form
Data Form
Form Menu Utama Private Sub a_Click() Data_Peminjam.Show End Sub Private Sub b_Click() Data_Buku.Show End Sub Private Sub c_Click() Data_Peminjaman.Show End Sub Private Sub d_Click() Data_Pengembalian.Show End Sub Private Sub e_Click() DataReport1.Show DataReport1.Refresh DataReport1.Top = 0 DataReport1.Left = 0 End Sub Private Sub h_click() sekolah.Show End Sub Private Sub g_click() Cetak.Show End Sub Private Sub f_Click() DataReport2.Show DataReport2.Refresh DataReport2.Top = 0 DataReport2.Left = 0 End Sub Private Sub mnkel_Click() Unload Me End Sub
Dim db As Database Dim rs1 As Recordset Const hitam = &H8000000F Const putih = vbWhite Private Sub tombol(tambah As Boolean, koreksi As Boolean, hapus As Boolean, simpan As Boolean) Command1.Enabled = tambah Command2.Enabled = koreksi Command3.Enabled = hapus Command4.Enabled = simpan End Sub Private Sub out() Unload Me End Sub Private Sub simpan() Dim ket If Text1.Enabled = True Then ket = MsgBox("Data Mau Disimpan....?", vbYesNo + vbQuestion, "Simpan") If ket = vbYes Then rs1.AddNew rs1(0) = Text1.Text rs1(1) = Text2.Text rs1(2) = Text3.Text rs1(3) = Combo1.Text rs1(4) = tgl.Value rs1(5) = Combo2.Text rs1(6) = Combo3.Text rs1(7) = Text4.Text rs1.Update Text1.Enabled = True Text1.Text = "" Text1.SetFocus End If Else ket = MsgBox("Data Koreksi Sudah Benar....?", vbYesNo + vbQuestion, "Edit") If ket = vbYes Then rs1.Edit rs1(0) = Text1.Text rs1(1) = Text2.Text rs1(2) = Text3.Text rs1(3) = Combo1.Text rs1(4) = tgl.Value rs1(5) = Combo2.Text rs1(6) = Combo3.Text rs1(7) = Text4.Text
rs1.Update Text1.Enabled = True Text1.Text = "" Text1.SetFocus End If End If End Sub Private Sub non(txt As Boolean, warna) Text2.Enabled = txt Text2.BackColor = warna Text3.Enabled = txt Text3.BackColor = warna Combo1.Enabled = txt Combo1.BackColor = warna Combo2.Enabled = txt Combo2.BackColor = warna Combo3.Enabled = txt Combo3.BackColor = warna Text4.Enabled = txt Text4.BackColor = warna End Sub Private Sub Command1_Click() Text1.Text = "" Text2.Text = "" Text3.Text = "" Combo1.Text = "" Combo2.Text = "" Combo3.Text = "" Text4.Text = "" non True, putih tombol True, False, True, True End Sub Private Sub Command4_Click() If Text1 = "" Or Text2 = "" Or Text3 = "" Or Combo1 = "" Or tgl = "" Or Combo2 = "" Or Combo3 = "" Or Text4 = "" Then MsgBox "Input Data Yang Benar....!" Else simpan End If End Sub Private Sub Command2_Click() koreksi End Sub Private Sub Command3_Click()
hapus End Sub Private Sub Command5_Click() Dim ket ket = MsgBox("Yakin Anda Mau Keluar........!", vbYesNo + vbQuestion, "keluar") If ket = vbYes Then Unload Me End If End Sub Private Sub Form_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then SendKeys "{tab}" End If End Sub Private Sub Form_Load() Set db = OpenDatabase(App.Path & "\pustaka.mdb") Set rs1 = db.OpenRecordset("anggota") rs1.Index = "index1" With Combo1 .AddItem "PRIA" .AddItem "WANITA" End With With Combo2 .AddItem "VIIA" .AddItem "VIIB" .AddItem "VIIC" .AddItem "VIID" .AddItem "VIIE" .AddItem "VIIF" .AddItem "VIIIA" .AddItem "VIIIB" .AddItem "VIIIC" .AddItem "VIIID" .AddItem "VIIIE" .AddItem "IXA" .AddItem "IXB" .AddItem "IXC" .AddItem "IXD" .AddItem "IXE" End With With Combo3 .AddItem "IPA" .AddItem "IPS" .AddItem "BAHASA" .AddItem "BELUM KEJURUSAN" End With
tombol True, False, False, True non False, hitam End Sub Private Sub Text1_Change() rs1.Seek "=", Text1.Text If Not rs1.NoMatch Then Text1.Text = Trim(rs1(0)) Text2.Text = Trim(rs1(1)) Text3.Text = Trim(rs1(2)) Combo1.Text = Trim(rs1(3)) tgl.Value = Trim(rs1(4)) Combo2.Text = Trim(rs1(5)) Combo3.Text = Trim(rs1(6)) Text4.Text = Trim(rs1(7)) Else Text2.Text = "" Text3.Text = "" Combo1.Text = "" Combo2.Text = "" Combo3.Text = "" Text4.Text = "" tombol True, True, True, True If Len(Text1.Text) < 1 Then non False, hitam Else Text2.Text = "" Text3.Text = "" Combo1.Text = "" Combo2.Text = "" Combo3.Text = "" Text4.Text = "" End If End If End Sub Private Sub koreksi() non True, putih Text1.Enabled = False tombol False, True, False, True Text2.SetFocus End Sub Private Sub hapus() Dim ket ket = MsgBox("Yakin Data Dihapus....?", vbYesNo + vbQuestion, "Hapus") If ket = vbYes Then rs1.Delete Text1.Enabled = True
Text1.Text = "" Text1.SetFocus End If End Sub Form Data Buku Dim db As Database Dim rs2 As Recordset Const hitam = &H8000000F Const putih = vbWhite Private Sub tombol(tambah As Boolean, koreksi As Boolean, hapus As Boolean, simpan As Boolean) Command1.Enabled = tambah Command2.Enabled = koreksi Command3.Enabled = hapus Command4.Enabled = simpan End Sub Private Sub out() Unload Me End Sub Private Sub simpan() Dim ket If Text1.Enabled = True Then ket = MsgBox("Data Buku Mau Disimpan....?", vbYesNo + vbQuestion, "Simpan") If ket = vbYes Then rs2.AddNew rs2(0) = Text1.Text rs2(1) = Text2.Text rs2(2) = Combo1.Text rs2(3) = Text3.Text rs2(4) = Combo2.Text rs2(5) = Text4.Text rs2(6) = Text5.Text rs2(7) = Text6.Text rs2(8) = Text7.Text rs2(9) = Text8.Text rs2.Update Text1.Enabled = True Text1.Text = "" Text1.SetFocus End If Else ket = MsgBox("Data Koreksi Sudah Benar....?", vbYesNo + vbQuestion, "Edit") If ket = vbYes Then rs2.Edit
rs2(0) = Text1.Text rs2(1) = Text2.Text rs2(2) = Combo1.Text rs2(3) = Text3.Text rs2(4) = Combo2.Text rs2(5) = Text4.Text rs2(6) = Text5.Text rs2(7) = Text6.Text rs2(8) = Text7.Text rs2(9) = Text8.Text rs2.Update Text1.Enabled = True Text1.Text = "" Text1.SetFocus End If End If End Sub Private Sub non(txt As Boolean, warna) Text2.Enabled = txt Text2.BackColor = warna Combo1.Enabled = txt Combo1.BackColor = warna Text3.Enabled = txt Text3.BackColor = warna Combo2.Enabled = txt Combo2.BackColor = warna Text4.Enabled = txt Text4.BackColor = warna Text5.Enabled = txt Text5.BackColor = warna Text6.Enabled = txt Text6.BackColor = warna Text7.Enabled = txt Text7.BackColor = warna Text8.Enabled = txt Text8.BackColor = warna End Sub Private Sub Command4_Click() If Text1 = "" Or Text2 = "" Or Combo1 = "" Or Text3 = "" Or Combo2 = "" Or Text4 = "" Or Text5 = "" Or Text6 = "" Or Text7 = "" Or Text8 = "" Then MsgBox "Input Data Buku Yang Benar....!" Else simpan End If End Sub Private Sub Command1_Click()
Text1.Text = "" Text2.Text = "" Combo1.Text = "" Text3.Text = "" Combo2.Text = "" Text4.Text = "" Text5.Text = "" Text6.Text = "" Text7.Text = "" Text8.Text = "" non True, putih tombol True, False, True, True End Sub Private Sub Command2_Click() koreksi End Sub Private Sub Command3_Click() hapus End Sub Private Sub Command5_Click() Dim ket ket = MsgBox("Yakin Anda Mau Keluar........!", vbYesNo + vbQuestion, "keluar") If ket = vbYes Then Unload Me End If End Sub Private Sub Form_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then SendKeys "{tab}" End If End Sub Private Sub Form_Load() Set db = OpenDatabase(App.Path & "\pustaka.mdb") Set rs2 = db.OpenRecordset("buku") rs2.Index = "index2" With Combo1 .AddItem "FIKSI" .AddItem "NON FIKSI" End With With Combo2 .AddItem "RAK 1" .AddItem "RAK 2" .AddItem "RAK 3" .AddItem "RAK 4"
.AddItem "RAK 5" .AddItem "RAK 6" .AddItem "RAK 7" .AddItem "RAK 8" .AddItem "RAK 9" End With tombol True, False, True, True non False, hitam End Sub Private Sub Text1_Change() rs2.Seek "=", Text1.Text If Not rs2.NoMatch Then Text1.Text = Trim(rs2(0)) Text2.Text = Trim(rs2(1)) Combo1.Text = Trim(rs2(2)) Text3.Text = Trim(rs2(3)) Combo2.Text = Trim(rs2(4)) Text4.Text = Trim(rs2(5)) Text5.Text = Trim(rs2(6)) Text6.Text = Trim(rs2(7)) Text7.Text = Trim(rs2(8)) Text8.Text = Trim(rs2(9)) Else Text2.Text = "" Combo1.Text = "" Text3.Text = "" Combo2.Text = "" Text4.Text = "" Text5.Text = "" Text6.Text = "" Text7.Text = "" Text8.Text = "" tombol True, True, True, True If Len(Text1.Text) < 1 Then non False, hitam Text2.Text = "" Combo1.Text = "" Text3.Text = "" Combo2.Text = "" Text4.Text = "" Text5.Text = "" Text6.Text = "" Text7.Text = "" Text8.Text = "" End If End If End Sub Private Sub koreksi()
non True, putih Text1.Enabled = False tombol False, True, False, True Text2.SetFocus End Sub Private Sub hapus() Dim ket ket = MsgBox("Yakin Data Buku Dihapus....?", vbYesNo + vbQuestion, "Hapus") If ket = vbYes Then rs2.Delete Text1.Enabled = True Text1.Text = "" Text1.SetFocus End If End Sub
Form Data Peminjaman Dim db As Database Dim rs3 As Recordset Dim rs1 As Recordset Dim rs2 As Recordset Const hitam = &H8000000F Const putih = vbWhite Private Sub tombol(tambah As Boolean, koreksi As Boolean, hapus As Boolean, simpan As Boolean) Command1.Enabled = tambah Command2.Enabled = koreksi Command3.Enabled = hapus Command4.Enabled = simpan End Sub Private Sub out() Unload Me End Sub Private Sub simpan() Dim ket If Combo1.Enabled = True Then ket = MsgBox("Peminjaman Mau Disimpan....?", vbYesNo + vbInformation, "Simpan") If ket = vbYes Then rs3.AddNew rs3(0) = Combo1.Text rs3(1) = tgl1.Value rs3(2) = Combo2.Text rs3(3) = tgl2.Value rs3.Update
ket = MsgBox("Mau Pinjam Buku Lagi........?", vbYesNo + vbQuestion, "Entry Data") If ket = vbYes Then Combo2.Enabled = True Combo2.Text = "" Combo2.SetFocus bersih End If End If Else ket = MsgBox("Data Peminjaman Sudah Benar...?", vbYesNo + vbQuestion, "Edit") If ket = vbYes Then rs3.Edit rs3(0) = Combo1.Text rs3(1) = tgl1.Value rs3(2) = Combo2.Text rs3(3) = tgl2.Value rs3.Update Combo1.Enabled = True Combo1.Text = "" Combo1.SetFocus End If End If End Sub Private Sub Combo1_Click() rs1.Seek "=", Combo1.Text If Not rs1.NoMatch Then Text1.Text = rs1(1) non True, putih tombol True, True, True, True End If End Sub Private Sub Combo2_Click() rs3.Seek "=", Combo1.Text, Combo2.Text If Not rs3.NoMatch Then tgl1.Value = rs3(1) tgl2.Value = rs3(3) Else tgl1.Enabled = True tgl2.Enabled = True End If rs2.Seek "=", Combo2.Text If Not rs2.NoMatch Then Text2.Text = rs2(1) Text3.Text = rs2(5) End If
End Sub Private Sub non(txt As Boolean, warna) Text1.Enabled = False Text1.BackColor = warna Text2.Enabled = False Text2.BackColor = warna Text3.Enabled = False Text3.BackColor = warna Combo2.Enabled = txt Combo2.BackColor = warna End Sub Private Sub Command1_Click() Combo1.Text = "" Text1.Text = "" Combo2.Text = "" Text2.Text = "" Text3.Text = "" End Sub Private Sub Command2_Click() koreksi End Sub Private Sub Command3_Click() hapus End Sub Private Sub Command4_Click() If Combo1 = "" Or Text1 = "" Or Combo2 = "" Or tgl1 = "" Or Text2 = "" Or Text3 = "" Or tgl2 = "" Then MsgBox "Input Data Yang Benar ...!" Else simpan End If End Sub Private Sub Command5_Click() Dim ket ket = MsgBox(" Anda Ingin Keluar..!", vbYesNo + vbQuestion, "Keluar") If ket = vbYes Then Unload Me End If End Sub Private Sub Form_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then SendKeys "{tab}"
End If End Sub Private Sub Form_Load() Set db = OpenDatabase(App.Path & "\pustaka.mdb") Set rs3 = db.OpenRecordset("peminjaman") rs3.Index = "index3" Set rs1 = db.OpenRecordset("anggota") rs1.Index = "index1" Set rs2 = db.OpenRecordset("buku") rs2.Index = "index2" While Not rs1.EOF Combo1.AddItem (rs1(0)) rs1.MoveNext Wend While Not rs2.EOF Combo2.AddItem (rs2(0)) rs2.MoveNext Wend tombol True, False, False, True non False, hitam End Sub Private Sub koreksi() Combo1.Enabled = False tombol False, True, False, True tgl1.SetFocus End Sub Private Sub hapus() Dim ket ket = MsgBox("Yakin Data Peminjaman Mau Dihapus....?", vbYesNo + vbQuestion, "Hapus") If ket = vbYes Then rs3.Delete non False, putih tombol False, True, True, False bersih_daeng tgl1.Enabled = True tgl2.Enabled = True Combo1.Enabled = True Combo1.Text = "" End If End Sub Private Sub bersih() Text2 = "" Combo2 = "" Text3 = ""
End Sub Private Sub bersih_daeng() Combo1.Text = "" Combo2.Text = "" Text1.Text = "" Text2.Text = "" Text3.Text = "" End Sub
Form Data Pengembalian Dim db As Database Dim rs4 As Recordset Dim rs1 As Recordset Dim rs2 As Recordset Const hitam = &H8000000F Const putih = vbWhite Private Sub tombol(tambah As Boolean, koreksi As Boolean, hapus As Boolean, simpan As Boolean) Command1.Enabled = tambah Command2.Enabled = koreksi Command3.Enabled = hapus Command4.Enabled = simpan End Sub Private Sub out() Unload Me End Sub Private Sub simpan() Dim ket If Combo1.Enabled = True Then ket = MsgBox("Pengembalian Buku Mau Disimpan....?", vbYesNo + vbInformation, "Simpan") If ket = vbYes Then rs4.AddNew rs4(0) = Combo1.Text rs4(1) = Combo2.Text rs4(2) = tgl5.Value rs4(3) = tgl6.Value rs4(4) = Text5.Text rs4.Update ket = MsgBox("Ada Buku Yang Dikembalikan Lagi........?", vbYesNo + vbQuestion, "Entry Data") If ket = vbYes Then Combo2.Enabled = True
Combo2.Text = "" Combo2.SetFocus bersih End If End If Else ket = MsgBox("Data Pengembalian Sudah Benar...?", vbYesNo + vbQuestion, "Edit") If ket = vbYes Then rs4.Edit rs4(0) = Combo1.Text rs4(1) = Combo2.Text rs4(2) = tgl5.Value rs4(3) = tgl6.Value rs4(4) = Text5.Text rs4.Update Combo1.Enabled = True Combo1.Text = "" Combo1.SetFocus End If End If End Sub Private Sub Combo1_Click() rs1.Seek "=", Combo1.Text If Not rs1.NoMatch Then Text1.Text = rs1(1) non True, putih tombol True, True, True, True End If End Sub Private Sub Combo2_Click() rs4.Seek "=", Combo1.Text, Combo2.Text If Not rs4.NoMatch Then Text5.Text = rs4(4) tgl5.Value = rs4(2) tgl6.Value = rs4(3) Else Text5.Text = "" tgl5.Enabled = True tgl6.Enabled = True End If rs2.Seek "=", Combo2.Text If Not rs2.NoMatch Then Text2.Text = rs2(1) Text3.Text = rs2(5) Text4.Text = rs2(9) End If
End Sub Private Sub non(txt As Boolean, warna) Text1.Enabled = False Text1.BackColor = warna Text2.Enabled = False Text2.BackColor = warna Text3.Enabled = False Text3.BackColor = warna Text4.Enabled = False Text4.BackColor = warna Text5.Enabled = txt Text5.BackColor = warna Combo2.Enabled = txt Combo2.BackColor = warna End Sub Private Sub Command1_Click() Combo1.Text = "" Text1.Text = "" Combo2.Text = "" Text2.Text = "" Text3.Text = "" Text4.Text = "" Text5.Text = "" End Sub Private Sub Command2_Click() koreksi End Sub Private Sub Command3_Click() hapus End Sub Private Sub Command4_Click() If Combo1 = "" Or Text1 = "" Or Combo2 = "" Or tgl5 = "" Or Text2 = "" Or Text3 = "" Or tgl6 = "" Or Text4 = "" Or Text5 = "" Then MsgBox "Input Data Pengembalian Yang Benar ...!" Else simpan End If End Sub Private Sub Command5_Click() Dim ket ket = MsgBox(" Anda Ingin Keluar..!", vbYesNo + vbQuestion, "Keluar") If ket = vbYes Then Unload Me
End If End Sub Private Sub Form_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then SendKeys "{tab}" End If End Sub Private Sub Form_Load() Set db = OpenDatabase(App.Path & "\pustaka.mdb") Set rs4 = db.OpenRecordset("pengembalian") rs4.Index = "index4" Set rs1 = db.OpenRecordset("anggota") rs1.Index = "index1" Set rs2 = db.OpenRecordset("buku") rs2.Index = "index2" While Not rs1.EOF Combo1.AddItem (rs1(0)) rs1.MoveNext Wend While Not rs2.EOF Combo2.AddItem (rs2(0)) rs2.MoveNext Wend tombol True, False, False, True non False, hitam End Sub Private Sub koreksi() Combo1.Enabled = False tombol False, True, False, True tgl5.SetFocus Text5.SetFocus End Sub Private Sub hapus() Dim ket ket = MsgBox("Yakin Data Peminjaman Mau Dihapus....?", vbYesNo + vbQuestion, "Hapus") If ket = vbYes Then rs4.Delete non False, putih tombol False, True, True, False Combo1.Text = "" Combo2.Text = "" Text1.Text = "" Text2.Text = "" Text3.Text = ""
Text4.Text = "" Text5.Text = "" tgl5.Enabled = True tgl6.Enabled = True End If End Sub Private Sub bersih() Combo2 = "" Text2 = "" Text3 = "" Text4 = "" Text5 = "" End Sub
Form Cetak Kartu Anggota Private Sub vbButton2_Click() If Text1 = "" Then MsgBox "Nomor anggota kosong" Exit Sub Text1.SetFocus End If Pesan = MsgBox("Printer sudah siap..?", vbYesNo, "Konfirmasi") If Pesan = vbYes Then Dim MGrs As String Printer.Font = "Courier New" Call Bukadb rsanggota.Open "select * from anggota Where nap ='" & Text1 & "'", conn Printer.Print Printer.FontBold = True Printer.Print Printer.FontBold = False Printer.CurrentX = 0 Printer.CurrentY = 0 Printer.Print Tab(5); "Nomor Anggota : "; rsanggota!nap Printer.Print Tab(5); "Nama Siswa : "; rsanggota!nama_siswa Printer.Print Tab(5); "NIS : "; rsanggota!nis Printer.Print Tab(5); "Jenis Kelamin : "; rsanggota!jenis_kelamin Printer.Print Tab(5); "Kelas : "; rsanggota!kelas Printer.Print Tab(5); "Alamat : "; rsanggota!alamat MGrs = String$(33, "-") Printer.Print Tab(5); MGrs Printer.Print Tab(5); MGrs Printer.Print
Printer.EndDoc End If End Sub Private Sub vbButton1_Click() Unload Me End Sub
Modul1 Public conn As New ADODB.Connection Public rsanggota As ADODB.Recordset Public Sub Bukadb() Dim str As String Set conn = New ADODB.Connection Set rsanggota = New ADODB.Recordset conn.Open "provider=Microsoft.Jet.OLEDB.4.0;Data Source =C:\perpustakaan\pustaka.mdb" End Sub
Kartu K Bimb ingan Tuga as Akhir Mahasiswa M Nama Nomor Indu uk Mahasis swa Judul Tuga as Akhir : R RAFIANI RE EYSAH : 07 72406111 : A Aplikasi Pe eminjaman Dan Microsoft Pe engembalian n Basic Buku Di
M Menggunaka an
Visual al
6.0
Pe erpustakaan n SMP Nege eri 1 Limap puluh Dosen Pem mbimbing Tanggal Mu ulai Bimbin ngan : D Drs. Sawalud ddin, M.IT : 22 2 Desember r 2009
Tanggal Se elesai Bimbi ingan : .... ................... ......... No Tan nggal Asistensi B Bimbingan Pem mbahasan Pada Asisten nsi M Mengenai, Pada P Bab : Para af Dosen Pem mbimbing Keterangan n
*Kartu ini harap dikembalikan ke e Departemen Ma atematika bila bim mbingan mahasisw wa telah selesai
SURAT KETERANGAN
Hasil Uji Program Tugas Akhir
Yang bertanda tangan di bawah ini, menerangkan bahwa Mahasiswa Tugas Akhir Program Diploma III Ilmu Komputer.
: RAFIANI REYSAH : 072406111 : ILMU KOMPUTER : APLIKASI PEMINJAMAN DAN PENGEMBALIAN BUKU MENGGUNAKAN MICROSOFT VISUAL BASIC 6.0 DI PERPUSTAKAAN SMP NEGERI 1 LIMAPULUH
Telah melaksanakan test program Tugas Akhir Mahasiswa tersebut di atas pada tanggal.
Demikian diterangkan untuk digunakan melengkapi Syarat Pendaftaran Ujian Meja Hijau Tugas Akhir Mahasiswa bersangkutan di Departemen Matematika FMIPA USU Medan.
Medan,
Mei 2010