Untuk Command Button, kesemua command button di beri nama cmdNav
Berikut Form Buku – Sistem Informasi Penjualan (VB6).
Private Sub CmdNav_Click(Index As Integer)
Select Case Index
Case 0
RUBAH False, True, False, False, True, True
Call Hapus
txtKD.SetFocus
Case 1
RUBAH True, False, False, False, False, True
SimpanData True
Case 2
RUBAH True, False, False, False, False, True
SimpanData False
Case 3
With Data1.Recordset
If .RecordCount = 0 Then Exit Sub
.Delete
.MoveFirst
End With
Call Hapus
Case 4
RUBAH True, False, False, False, False, True
Call Hapus
Case 5
Unload Me
End Select
End Sub
Private Sub Form_Activate() RUBAH True, False, False, False, False, True
End Sub
Private Sub txtKd_KeyPress(KeyAscii As Integer) KeyAscii = Asc(UCase(Chr(KeyAscii)))
If KeyAscii = 13 Then
If txtKD.Text = “” Then
txtKD.SetFocus
Else
With Data1.Recordset
.Index = “KdBarang”
.Seek “=”, txtKD.Text
If .NoMatch Then
x = txtKD.Text
Hapus
txtKD.Text = x
RUBAH False, True, False, False, True, True
Else
RUBAH False, False, True, True, True, True
Call Tampil
End If
txtNama.SetFocus
End With
End If
End If
End Sub
Sub SimpanData(Log As Boolean) ‘On Error Resume Next
With Data1.Recordset
If Log Then .AddNew Else .edit
!KdBarang = txtKD.Text
!Nama = txtNama.Text
!pengarang = txtPengarang.Text
!Penerbit = txtPenerbit.Text
!harga = txtHarga.Text
!Stock = txtStock.Text
.Update
End With
Data1.Refresh
Call Hapus
End Sub
Sub Tampil() On Error Resume Next
With Data1.Recordset
txtNama.Text = !Nama
txtHarga.Text = !harga
txtPengarang.Text = !pengarang
txtPenerbit.Text = !Penerbit
txtStock.Text = !Stock
End With
End Sub
Sub Hapus() txtKD.Text = “”
txtNama.Text = “”
txtHarga.Text = “”
txtPengarang.Text = “”
txtPenerbit.Text = “”
txtStock.Text = “”
End Sub
Sub RUBAH(L0 As Boolean, L1 As Boolean, L2 As Boolean, L3 As Boolean, L4 As Boolean, L5 As Boolean) CmdNav(0).Enabled = L0
CmdNav(1).Enabled = L1
CmdNav(2).Enabled = L2
CmdNav(3).Enabled = L3
CmdNav(4).Enabled = L4
CmdNav(5).Enabled = L5
End Sub
Demikianlah aktivitas Form Buku – Sistem Informasi Penjualan (VB6)
Script yang akan kami share kali ini digunakan untuk form input nama lokasi, yang pertama…
Meskipun masih sederhana tapi aplikasi cuti karyawan online ini cukup bagus untuk dijadikan bahan pembelajaran…
Sistem Perwalian Online Sistem kartu rencana studi online berbasis web, dibuat dengan menggunakan Codeigniter 2.1*.…
Kemajuan teknologi hari ini menuntut aktifitas manusia untuk berjalan menjadi lebih aktif dan cepat. Tidak…
Download Source Code Aplikasi untuk mengelola kasbon karyawan berbasis php. Program ini dibuat menggunakan bahasa…
Pada postingan kali ini, sourcecodeaplikasi.info kembali mencoba untuk membagikan ke sobat semua tentang sebuah aplikasi…