Posted by : Miftahul Baihaqi Annazili March 9, 2016


Untuk membuat software tersebut saya menggunakan program Microsoft Visual Studio yang bisa teman-teman download secara free  dari google tinggal di search aja :D. Database yang saya gunakan adalah Microsoft Access.

Toolbox yang digunakan adalah : 
- Label
- Frame
- TextBox
- Command Button
- Data Grid
- Adodc

Berikut adalah source code dari program tersebut : 

Sub bersih()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
End Sub

Private Sub Command1_Click()
If Text1.Text = "" Or Text2.Text = "" Or Text3.Text = "" Then
MsgBox ("Data Belum Terisi atau Lengkap")
Else
Adodc1.Recordset.AddNew
Adodc1.Recordset!kode_buku = Text1.Text
Adodc1.Recordset!nama_buku = Text2.Text
Adodc1.Recordset!harga = Text3.Text
Call bersih
End If
End Sub

Private Sub Command2_Click()
If Adodc1.Recordset!kode_buku = Text1.Text Then
Adodc1.Recordset.Update
Adodc1.Recordset!kode_buku = Text1.Text
Adodc1.Recordset!nama_buku = Text2.Text
Adodc1.Recordset!harga = Text3.Text
Call bersih
Command1.Enabled = True
Command3.Enabled = True
Command4.Enabled = True
Command5.Enabled = True
Command6.Enabled = True
ElseIf Text1.Text = "" Then
MsgBox ("Anda Harus Mencari Kode Buku di Kolom Search")
Text4.SetFocus
End If
End Sub

Private Sub Command3_Click()
Call bersih
End Sub

Private Sub Command4_Click()
konfirmasi = MsgBox("Yakin Akan Dihapus???", vbYesNo + vbInformation, "Konfirmasi")
If konfirmasi = vbYes Then
    Adodc1.Recordset.Delete
End If
End Sub

Private Sub Command5_Click()
konfirmasi = MsgBox("Yakin Mau Keluar???", vbYesNo + vbInformation, "Keluar")
If konfirmasi = vbYes Then
    End
End If
End Sub

Private Sub Command6_Click()
Adodc1.Recordset.Find "kode_buku ='" & Text4.Text & "'", , adSearchForward, 1
If Not Adodc1.Recordset.EOF Then
    Text1.Text = Adodc1.Recordset!kode_buku
    Text2.Text = Adodc1.Recordset!nama_buku
    Text3.Text = Adodc1.Recordset!harga
    Command1.Enabled = False
    Command3.Enabled = False
    Command4.Enabled = False
    Command5.Enabled = False
    Command6.Enabled = False
Else
    MsgBox ("Data Tidak Ditemukan")
    Text4.Text = ""
    Text4.SetFocus
End If
End Sub

Private Sub Form_Load()
Call bersih
End Sub


Private Sub Timer1_Timer()
Label5.Caption = Format(Now, "hh:mm:ss")
Label6.Caption = Format(Now, "dddd:d mmmm:yyyy")
End Sub

========================================================================

Untuk Informasi Lebih Lanjut bisa menghubungi :
javashare29@gmail.com atau Komentar di bagian bawah postingan ini.

>> Terima Kasih <<

{ 4 comments... read them below or Comment }

  1. kasih tau gan yang mana yang command 1 atau yang lainnya ,,kalo ada pembaca yang baru belajar vb bingung tuh ,,,,kalo ane mah ngerti :v thankx infonya :D

    ReplyDelete
    Replies
    1. Makasih atas masukannya .. lain kali akan saya lebih perbaiki lagi dalam penyampaian program hingga tuntas

      Delete
  2. Terima kasih
    Artikelnya sangat membantu :D

    ReplyDelete
    Replies
    1. iya gan sama-sama.. jika ada kendala hubungi by email atau fanspage fb ya gan.. :D

      Delete

- Copyright © Java Sae - Hatsune Miku - Powered by Blogger - Designed by Johanes Djogan -