Minggu, 18 April 2010

vb list code

IPRODUK

Private Sub Command1_Click()
Data1.Recordset.Index = "KDP"
Data1.Recordset.Seek "=", kp.Text
If Data1.Recordset.NoMatch Then
np.SetFocus
Command2.Enabled = True
Else
np.Text = Data1.Recordset!NAMA_PRODUK
np.Enabled = False
jp.Text = Data1.Recordset!SATUAN
jp.Enabled = False
hp.Text = Data1.Recordset!HARGA
hp.Enabled = False
Command3.Enabled = True
Command4.SetFocus
End If
End Sub

Private Sub Command2_Click()
Command2.Enabled = False
Data1.Recordset.Index = "KDP"
Data1.Recordset.Seek "=", kp.Text
If Data1.Recordset.NoMatch Then
Data1.Recordset.AddNew
Data1.Recordset!KD_PRODUK = kp.Text
Data1.Recordset!NAMA_PRODUK = np.Text
Data1.Recordset!SATUAN = Val(jml.Text)
Data1.Recordset!HARGA = hp.Text
Data1.Recordset.Update
Else
Data1.Recordset.Edit
Data1.Recordset!KD_PRODUK = kp.Text
Data1.Recordset!NAMA_PRODUK = np.Text
Data1.Recordset!SATUAN = Val(jml.Text)
Data1.Recordset!HARGA = hp.Text
Data1.Recordset.Update
End If
bersih
End Sub

Private Sub Command3_Click()
MsgBox "PENGHAPUSAN DATA PRODUK", vbInformation, "PROSES"
Data1.Recordset.Delete
Command3.Enabled = False
bersih
End Sub

Private Sub Command4_Click()
bersih
End Sub

Private Sub bersih()
kp = ""
kp.Enabled = True
np = ""
jml = ""
np.Enabled = True
jp = ""
jp.Enabled = True
hp = ""
hp.Enabled = True
kp.SetFocus
Command2.Enabled = False
Command3.Enabled = False
End Sub

Private Sub Command5_Click()
Unload Me
End Sub

Private Sub hp_Change()
ttl.Text = Val(jml.Text) * Val(hp.Text)
End Sub


Private Sub kp_keypress(keyascii As Integer)
If keyascii = 13 Then
Data1.Recordset.Index = "KDP"
Data1.Recordset.Seek "=", kp.Text
If Data1.Recordset.NoMatch Then
np.SetFocus
Command2.Enabled = True
Else
MsgBox "DATA PRODUK SUDAH DIKENAL! MAU LIHAT?", vbInformation, "PERINGATAN"
np.Text = Data1.Recordset!NAMA_PRODUK
np.Enabled = False
jp.Text = Data1.Recordset!SATUAN
jp.Enabled = False
hp.Text = Data1.Recordset!HARGA
hp.Enabled = False
jml.Enabled = False
Command3.Enabled = True
Command4.SetFocus
End If
End If
End Sub

IPEMASOK

Private Sub Command1_Click()
Data1.Recordset.Index = "KDPM"
Data1.Recordset.Seek "=", kpm.Text
If Data1.Recordset.NoMatch Then
npm.SetFocus
Command2.Enabled = True
Else
npm.Text = Data1.Recordset!NAMA_PEMASOK
npm.Enabled = False
almt.Text = Data1.Recordset!ALAMAT_PEMASOK
almt.Enabled = False
kt.Text = Data1.Recordset!KOTA
kt.Enabled = False
tlp.Text = Data1.Recordset!TELEPON
tlp.Enabled = False
Command3.Enabled = True
Command4.SetFocus
End If
End Sub

Private Sub Command2_Click()
Command2.Enabled = False
Data1.Recordset.Index = "KDPM"
Data1.Recordset.Seek "=", kpm.Text
If Data1.Recordset.NoMatch Then
Data1.Recordset.AddNew
Data1.Recordset!KD_PEMASOK = kpm.Text
Data1.Recordset!NAMA_PEMASOK = npm.Text
Data1.Recordset!ALAMAT_PEMASOK = almt.Text
Data1.Recordset!KOTA = kt.Text
Data1.Recordset!TELEPON = tlp.Text
Data1.Recordset.Update
Else
Data1.Recordset.Edit
Data1.Recordset!KD_PEMASOK = kpm.Text
Data1.Recordset!NAMA_PEMASOK = npm.Text
Data1.Recordset!ALAMAT_PEMASOK = almt.Text
Data1.Recordset!KOTA = kt.Text
Data1.Recordset!TELEPON = tlp.Text
Data1.Recordset.Update
End If
bersih
End Sub

Private Sub Command3_Click()
MsgBox "PENGHAPUSAN DATA PEMASOK", vbInformation, "PROSES"
Data1.Recordset.Delete
Command3.Enabled = False
bersih
End Sub

Private Sub Command4_Click()
bersih
End Sub

Private Sub bersih()
kpm = ""
kpm.Enabled = True
npm = ""
npm.Enabled = True
almt = ""
almt.Enabled = True
kt = ""
kt.Enabled = True
tlp = ""
tlp.Enabled = True
kpm.SetFocus
Command2.Enabled = False
Command3.Enabled = False
End Sub

Private Sub Command5_Click()
Unload Me
End Sub

Private Sub kpm_keypress(keyascii As Integer)
If keyascii = 13 Then
Data1.Recordset.Index = "KDPM"
Data1.Recordset.Seek "=", kpm.Text
If Data1.Recordset.NoMatch Then
npm.SetFocus
Command2.Enabled = True
Else
MsgBox "DATA PEMASOK SUDAH DIKENAL! MAU LIHAT?", vbInformation, "PERINGATAN"
npm.Text = Data1.Recordset!NAMA_PEMASOK
npm.Enabled = False
almt.Text = Data1.Recordset!ALAMAT_PEMASOK
almt.Enabled = False
kt.Text = Data1.Recordset!KOTA
kt.Enabled = False
tlp.Text = Data1.Recordset!TELEPON
tlp.Enabled = False
Command3.Enabled = True
Command4.SetFocus
End If
End If
End Sub

IPELANGGAN

Private Sub Command1_Click()
Data2.Recordset.Index = "KDPL"
Data2.Recordset.Seek "=", kpl.Text
If Data2.Recordset.NoMatch Then
npl.SetFocus
Command2.Enabled = True
Else
npl.Text = Data2.Recordset!NAMA_PELANGGAN
npl.Enabled = False
almt.Text = Data2.Recordset!ALAMAT_PELANGGAN
almt.Enabled = False
tlp.Text = Data2.Recordset!TELEPON
tlp.Enabled = False
Command3.Enabled = True
Command4.SetFocus
End If
End Sub

Private Sub Command2_Click()
Command2.Enabled = False
Data2.Recordset.Index = "KDPL"
Data2.Recordset.Seek "=", kpl.Text
If Data2.Recordset.NoMatch Then
Data2.Recordset.AddNew
Data2.Recordset!KD_PELANGGAN = kpl.Text
Data2.Recordset!NAMA_PELANGGAN = npl.Text
Data2.Recordset!ALAMAT_PELANGGAN = almt.Text
Data2.Recordset!TELEPON = tlp.Text
Data2.Recordset.Update
Else
Data2.Recordset.Edit
Data2.Recordset!KD_PELANGGAN = kpl.Text
Data2.Recordset!NAMA_PELANGGAN = npl.Text
Data2.Recordset!ALAMAT_PELANGGAN = almt.Text
Data2.Recordset!TELEPON = tlp.Text
Data2.Recordset.Update
End If
bersih
End Sub

Private Sub Command3_Click()
MsgBox "PENGHAPUSAN DATA PELANGGAN", vbInformation, "PROSES"
Data2.Recordset.Delete
Command3.Enabled = False
bersih
End Sub

Private Sub Command4_Click()
bersih
End Sub

Private Sub bersih()
kpl = ""
kpl.Enabled = True
npl = ""
npl.Enabled = True
almt = ""
almt.Enabled = True
tlp = ""
tlp.Enabled = True
kpl.SetFocus
Command2.Enabled = False
Command3.Enabled = False
End Sub

Private Sub Command5_Click()
Unload Me
End Sub

Private Sub kpl_keypress(keyascii As Integer)
If keyascii = 13 Then
Data2.Recordset.Index = "KDPL"
Data2.Recordset.Seek "=", kpl.Text
If Data2.Recordset.NoMatch Then
npl.SetFocus
Command2.Enabled = True
Else
MsgBox "DATA PELANGGAN SUDAH DIKENAL! MAU LIHAT?", vbInformation, "PERINGATAN"
npl.Text = Data2.Recordset!NAMA_PELANGGAN
npl.Enabled = False
almt.Text = Data2.Recordset!ALAMAT_PELANGGAN
almt.Enabled = False
tlp.Text = Data2.Recordset!TELEPON
tlp.Enabled = False
Command3.Enabled = True
Command4.SetFocus
End If
End If
End Sub

IJUAL

Private Sub Command1_Click()
Data2.Recordset.Index = "KDP"
Data2.Recordset.Seek "=", kp.Text
If Data2.Recordset.NoMatch Then
MsgBox "DATA PRODUK TIDAK DIKENAL", vbInformation, "PERINGATAN"
kp.SetFocus
kp = ""
Else
jj.SetFocus
hj.Text = Data2.Recordset!HARGA + Data2.Recordset!HARGA * 0.5
jp.Text = Data2.Recordset!SATUAN
End If
End Sub

Private Sub Command2_Click()
Command2.Enabled = False
Data3.Recordset.Index = "NFJ"
Data3.Recordset.Seek "=", nf.Text
If Data3.Recordset.NoMatch Then
Data3.Recordset.AddNew
Data3.Recordset!NOFAK_JUAL = nf.Text
Data3.Recordset!KD_PRODUK = kp.Text
Data3.Recordset!KD_PELANGGAN = kpl.Text
Data3.Recordset!BANYAK = Val(jj.Text)
Data3.Recordset!HARGA = Val(hj.Text)
Data3.Recordset!TANGGAL = tgl.Text
Data3.Recordset.Update
Else
Data3.Recordset.Edit
Data3.Recordset!NOFAK_JUAL = nf.Text
Data3.Recordset!KD_PRODUK = kp.Text
Data3.Recordset!KD_PELANGGAN = kpl.Text
Data3.Recordset!BANYAK = Val(jj.Text)
Data3.Recordset!HARGA = Val(hj.Text)
Data3.Recordset!TANGGAL = tgl.Text
Data3.Recordset.Update
End If
Data2.Recordset.Edit
Data2.Recordset!SATUAN = Val(jp.Text) - Val(jj.Text)
Data2.Recordset.Update
bersih
End Sub

Private Sub Command3_Click()
MsgBox "PENGHAPUSAN FAKTUR DATA PENJUALAN", vbInformation, "PROSES"
Data3.Recordset.Delete
Command3.Enabled = False
bersih
End Sub

Private Sub Command4_Click()
Command2.Enabled = False
Command3.Enabled = False
Command6.Enabled = True
Command1.Enabled = True
bersih
End Sub
Private Sub bersih()
kp = ""
kp.Enabled = True
kpl = ""
kpl.Enabled = True
nf = ""
nf.Enabled = True
jp = ""
tgl.Mask = ""
tgl.Enabled = True
jj = ""
jj.Enabled = True
hj = ""
hj.Enabled = True
nf.SetFocus
End Sub

Private Sub Command5_Click()
Unload Me
End Sub

Private Sub Command6_Click()
Data1.Recordset.Index = "KDPL"
Data1.Recordset.Seek "=", kpl.Text
If Data1.Recordset.NoMatch Then
kpm.SetFocus
MsgBox "DATA PELANGGAN TIDAK DIKENAL", vbInformation, "PERINGATAN"
kpl.SetFocus
kpl = ""
Else
kp.SetFocus
End If
End Sub

Private Sub Command7_Click()
Data3.Recordset.Index = "NFJ"
Data3.Recordset.Seek "=", nf.Text
If Data3.Recordset.NoMatch Then
kpl.SetFocus
Command2.Enabled = True
Else
MsgBox "FAKTUR SUDAH DIKENAL! MAU LIHAT?", vbInformation, "PERINGATAN"
kp.Text = Data3.Recordset!KD_PRODUK
kp.Enabled = False
kpl.Text = Data3.Recordset!KD_PELANGGAN
kpl.Enabled = False
hj.Text = Data3.Recordset!HARGA
hj.Enabled = False
jj.Text = Data3.Recordset!BANYAK
jj.Enabled = False
jp.Text = Data2.Recordset!SATUAN
jp.Enabled = False
tgl.Text = Data3.Recordset!TANGGAL
hj.Enabled = False
Command2.Enabled = False
Command6.Enabled = False
Command1.Enabled = False
Command3.Enabled = True
Command4.SetFocus
End If
End Sub

Private Sub jj_Change()
Command2.Enabled = True
tot.Text = Val(jj.Text) * Val(hj.Text)
End Sub

Private Sub kp_keypress(keyascii As Integer)
If keyascii = 13 Then
Data2.Recordset.Index = "KDP"
Data2.Recordset.Seek "=", kp.Text
If Data2.Recordset.NoMatch Then
MsgBox "DATA PRODUK TIDAK DIKENAL", vbInformation, "PERINGATAN"
kp.SetFocus
kp = ""
Else
jj.SetFocus
hj.Text = Data2.Recordset!HARGA + Data2.Recordset!HARGA * 0.5
jp.Text = Data2.Recordset!SATUAN
End If
End If
End Sub

Private Sub kpl_keypress(keyascii As Integer)
If keyascii = 13 Then
Data1.Recordset.Index = "KDPL"
Data1.Recordset.Seek "=", kpl.Text
If Data1.Recordset.NoMatch Then
MsgBox "DATA PELANGGAN TIDAK DIKENAL", vbInformation, "PERINGATAN"
kpl.SetFocus
kpl = ""
Else
kp.SetFocus
End If
End If
End Sub

Private Sub nf_keypress(keyascii As Integer)
If keyascii = 13 Then
Data3.Recordset.Index = "NFJ"
Data3.Recordset.Seek "=", nf.Text
If Data3.Recordset.NoMatch Then
kpl.SetFocus
Command2.Enabled = True
Else
MsgBox "FAKTUR SUDAH DIKENAL! MAU LIHAT?", vbInformation, "PERINGATAN"
kp.Text = Data3.Recordset!KD_PRODUK
kp.Enabled = False
kpl.Text = Data3.Recordset!KD_PELANGGAN
kpl.Enabled = False
hj.Text = Data3.Recordset!HARGA
hj.Enabled = False
jj.Text = Data3.Recordset!BANYAK
jj.Enabled = False
jp.Text = Data2.Recordset!SATUAN
jp.Enabled = False
tgl.Text = Data3.Recordset!TANGGAL
hj.Enabled = False
tgl.Enabled = False
Command2.Enabled = False
Command6.Enabled = False
Command1.Enabled = False
Command3.Enabled = True
Command4.SetFocus
End If
End If
End Sub


EPRODUK

Private Sub Command1_Click()
Data1.Recordset.Index = "KDP"
Data1.Recordset.Seek "=", kp.Text
If Data1.Recordset.NoMatch Then
MsgBox "DATA TIDAK DIKENAL", vbInformation, "PERINGATAN"
bersih
Else
MsgBox "PENCARIAN DATA PRODUK SUDAH KETEMU! MAU LIHAT?", vbInformation, "PERINGATAN"
np.Text = Data1.Recordset!NAMA_PRODUK
np.Enabled = False
jp.Text = Data1.Recordset!SATUAN
jp.Enabled = False
hp.Text = Data1.Recordset!HARGA
hp.Enabled = False
Command3.Enabled = True
End If
End Sub

Private Sub Command2_Click()
Command2.Enabled = False
Data1.Recordset.Index = "KDP"
Data1.Recordset.Seek "=", kp.Text
If Data1.Recordset.NoMatch Then
Data1.Recordset.AddNew
Data1.Recordset!KD_PRODUK = kp.Text
Data1.Recordset!NAMA_PRODUK = np.Text
Data1.Recordset!SATUAN = Val(jp.Text) + Val(jml.Text)
Data1.Recordset!HARGA = hp.Text
Data1.Recordset.Update
Else
Data1.Recordset.Edit
Data1.Recordset!KD_PRODUK = kp.Text
Data1.Recordset!NAMA_PRODUK = np.Text
Data1.Recordset!SATUAN = Val(jp.Text) + Val(jml.Text)
Data1.Recordset!HARGA = hp.Text
Data1.Recordset.Update
End If
bersih
End Sub

Private Sub Command3_Click()
np.Enabled = True
hp.Enabled = True
Command3.Enabled = False
Command2.Enabled = True
np.SetFocus
End Sub

Private Sub Command4_Click()
bersih
End Sub

Private Sub bersih()
kp = ""
np = ""
np.Enabled = False
jp = ""
jp.Enabled = False
jml = ""
hp = ""
hp.Enabled = False
kp.SetFocus
Command2.Enabled = False
Command3.Enabled = False
End Sub

Private Sub Command5_Click()
Unload Me
End Sub

Private Sub jml_Change()
Command2.Enabled = True
TOT.Text = Val(jp.Text) * Val(hp.Text)
End Sub


Private Sub kp_keypress(keyascii As Integer)
If keyascii = 13 Then
Data1.Recordset.Index = "KDP"
Data1.Recordset.Seek "=", kp.Text
If Data1.Recordset.NoMatch Then
MsgBox "DATA TIDAK DIKENAL", vbInformation, "PERINGATAN"
bersih
Else
MsgBox "PENCARIAN DATA PRODUK SUDAH KETEMU! MAU LIHAT?", vbInformation, "PERINGATAN"
np.Text = Data1.Recordset!NAMA_PRODUK
np.Enabled = False
jp.Text = Data1.Recordset!SATUAN
jp.Enabled = False
hp.Text = Data1.Recordset!HARGA
hp.Enabled = False
Command3.Enabled = True
End If
End If
End Sub

EPEMASOK

Private Sub Command1_Click()
Data1.Recordset.Index = "KDPM"
Data1.Recordset.Seek "=", kpm.Text
If Data1.Recordset.NoMatch Then
MsgBox "KODE PEMASOK TIDAK DIKENAL", vbInformation, "PERINGATAN"
bersih
Else
MsgBox "PENCARIAN DATA PEMASOK SUDAH KETEMU! MAU LIHAT?", vbInformation, "PERINGATAN"
npm.Text = Data1.Recordset!NAMA_PEMASOK
npm.Enabled = False
almt.Text = Data1.Recordset!ALAMAT_PEMASOK
almt.Enabled = False
kt.Text = Data1.Recordset!KOTA
kt.Enabled = False
tlp.Text = Data1.Recordset!TELEPON
tlp.Enabled = False
Command3.Enabled = True
End If
End Sub

Private Sub Command2_Click()
Command2.Enabled = False
Data1.Recordset.Index = "KDPM"
Data1.Recordset.Seek "=", kpm.Text
If Data1.Recordset.NoMatch Then
Data1.Recordset.AddNew
Data1.Recordset!KD_PEMASOK = kpm.Text
Data1.Recordset!NAMA_PEMASOK = npm.Text
Data1.Recordset!ALAMAT_PEMASOK = almt.Text
Data1.Recordset!KOTA = kt.Text
Data1.Recordset!TELEPON = tlp.Text
Data1.Recordset.Update
Else
Data1.Recordset.Edit
Data1.Recordset!KD_PEMASOK = kpm.Text
Data1.Recordset!NAMA_PEMASOK = npm.Text
Data1.Recordset!ALAMAT_PEMASOK = almt.Text
Data1.Recordset!KOTA = kt.Text
Data1.Recordset!TELEPON = tlp.Text
Data1.Recordset.Update
End If
bersih
End Sub

Private Sub Command3_Click()
npm.Enabled = True
almt.Enabled = True
kt.Enabled = True
tlp.Enabled = True
Command3.Enabled = False
Command2.Enabled = True
npm.SetFocus
End Sub

Private Sub Command4_Click()
bersih
End Sub

Private Sub bersih()
kpm = ""
npm = ""
npm.Enabled = False
almt = ""
almt.Enabled = False
kt = ""
kt.Enabled = False
tlp = ""
tlp.Enabled = False
kpm.SetFocus
Command2.Enabled = False
Command3.Enabled = False
End Sub

Private Sub Command5_Click()
Unload Me
End Sub

Private Sub kpm_keypress(keyascii As Integer)
If keyascii = 13 Then
Data1.Recordset.Index = "KDPM"
Data1.Recordset.Seek "=", kpm.Text
If Data1.Recordset.NoMatch Then
MsgBox "DATA PEMASOK TIDAK DIKENAL", vbInformation, "PERINGATAN"
bersih
Else
MsgBox "PENCARIAN DATA PEMASOK SUDAH KETEMU! MAU LIHAT?", vbInformation, "PERINGATAN"
npm.Text = Data1.Recordset!NAMA_PEMASOK
npm.Enabled = False
almt.Text = Data1.Recordset!ALAMAT_PEMASOK
almt.Enabled = False
kt.Text = Data1.Recordset!KOTA
kt.Enabled = False
tlp.Text = Data1.Recordset!TELEPON
tlp.Enabled = False
Command3.Enabled = True
End If
End If
End Sub

EPELANGGAN

Private Sub Command1_Click()
Data1.Recordset.Index = "KDPL"
Data1.Recordset.Seek "=", kpl.Text
If Data1.Recordset.NoMatch Then
MsgBox "KODE PELANGGAN TIDAK DIKENAL", vbInformation, "PERINGATAN"
bersih
Else
MsgBox "PENCARIAN DATA PELANGGAN SUDAH KETEMU! MAU LIHAT?", vbInformation, "PERINGATAN"
npl.Text = Data1.Recordset!NAMA_PELANGGAN
npl.Enabled = False
almt.Text = Data1.Recordset!ALAMAT_PELANGGAN
almt.Enabled = False
tlp.Text = Data1.Recordset!TELEPON
tlp.Enabled = False
Command3.Enabled = True
End If
End Sub

Private Sub Command2_Click()
Command2.Enabled = False
Data1.Recordset.Index = "KDPL"
Data1.Recordset.Seek "=", kpl.Text
If Data1.Recordset.NoMatch Then
Data1.Recordset.AddNew
Data1.Recordset!KD_PELANGGAN = kpl.Text
Data1.Recordset!NAMA_PELANGGAN = npl.Text
Data1.Recordset!ALAMAT_PELANGGAN = almt.Text
Data1.Recordset!TELEPON = tlp.Text
Data1.Recordset.Update
Else
Data1.Recordset.Edit
Data1.Recordset!KD_PELANGGAN = kpl.Text
Data1.Recordset!NAMA_PELANGGAN = npl.Text
Data1.Recordset!ALAMAT_PELANGGAN = almt.Text
Data1.Recordset!TELEPON = tlp.Text
Data1.Recordset.Update
End If
bersih
End Sub

Private Sub Command3_Click()
npl.Enabled = True
almt.Enabled = True
tlp.Enabled = True
Command3.Enabled = False
Command2.Enabled = True
npl.SetFocus
End Sub

Private Sub Command4_Click()
bersih
End Sub

Private Sub bersih()
kpl = ""
npl = ""
npl.Enabled = False
almt = ""
almt.Enabled = False
tlp = ""
tlp.Enabled = False
kpl.SetFocus
Command2.Enabled = False
Command3.Enabled = False
End Sub

Private Sub Command5_Click()
Unload Me
End Sub

Private Sub kpl_keypress(keyascii As Integer)
If keyascii = 13 Then
Data1.Recordset.Index = "KDPL"
Data1.Recordset.Seek "=", kpl.Text
If Data1.Recordset.NoMatch Then
MsgBox "DATA PELANGGAN TIDAK DIKENAL", vbInformation, "PERINGATAN"
bersih
Else
MsgBox "PENCARIAN DATA PELANGGAN SUDAH KETEMU! MAU LIHAT?", vbInformation, "PERINGATAN"
npl.Text = Data1.Recordset!NAMA_PELANGGAN
npl.Enabled = False
almt.Text = Data1.Recordset!ALAMAT_PELANGGAN
almt.Enabled = False
tlp.Text = Data1.Recordset!TELEPON
tlp.Enabled = False
Command3.Enabled = True
End If
End If
End Sub

EJAUAL

Option Explicit

Private Sub Command3_Click()
Command1.Enabled = True
HIDUP
Command6.Enabled = True
Command3.Enabled = False
End Sub
Private Sub HIDUP()
kp.Enabled = True
kpl.Enabled = True
nf.Enabled = True
tgl.Enabled = True
jj.Enabled = True
hj.Enabled = True
jj.SetFocus
End Sub

Private Sub Command1_Click()
Data2.Recordset.Index = "KDP"
Data2.Recordset.Seek "=", kp.Text
If Data2.Recordset.NoMatch Then
MsgBox "DATA PRODUK TIDAK DIKENAL", vbInformation, "PERINGATAN"
kp.SetFocus
kp = ""
Else
jj.SetFocus
hj.Text = Data2.Recordset!HARGA + Data2.Recordset!HARGA * 0.5
jp.Text = Data2.Recordset!SATUAN
End If
End Sub

Private Sub Command2_Click()
Data3.Recordset.Index = "NFJ"
Data3.Recordset.Seek "=", nf.Text
If Data3.Recordset.NoMatch Then
Data3.Recordset.AddNew
Data3.Recordset!NOFAK_JUAL = nf.Text
Data3.Recordset!KD_PRODUK = kp.Text
Data3.Recordset!KD_PELANGGAN = kpl.Text
Data3.Recordset!BANYAK = Val(jj.Text)
Data3.Recordset!HARGA = Val(hj.Text)
Data3.Recordset!TANGGAL = tgl.Text
Data3.Recordset.Update
Else
Data3.Recordset.Edit
Data3.Recordset!NOFAK_JUAL = nf.Text
Data3.Recordset!KD_PRODUK = kp.Text
Data3.Recordset!KD_PELANGGAN = kpl.Text
Data3.Recordset!BANYAK = Val(jj.Text)
Data3.Recordset!HARGA = Val(hj.Text)
Data3.Recordset!TANGGAL = tgl.Text
Data3.Recordset.Update
End If
Data2.Recordset.Edit
Data2.Recordset!SATUAN = Val(jp.Text) - Val(jj.Text)
Data2.Recordset.Update
bersih
Command2.Enabled = False
End Sub

Private Sub Command4_Click()
bersih
Command2.Enabled = False
Command3.Enabled = False
Command6.Enabled = False
Command1.Enabled = False

End Sub
Private Sub bersih()
kp = ""
kp.Enabled = True
kpl = ""
kpl.Enabled = True
nf = ""
nf.Enabled = True
jp = ""
tgl.Mask = ""
tgl.Enabled = False
jj = ""
jj.Enabled = True
hj = ""
hj.Enabled = True
nf.SetFocus
End Sub

Private Sub Command5_Click()
Unload Me
End Sub

Private Sub Command6_Click()
Data1.Recordset.Index = "KDPL"
Data1.Recordset.Seek "=", kpl.Text
If Data1.Recordset.NoMatch Then
MsgBox "DATA PELANGGAN TIDAK DIKENAL", vbInformation, "PERINGATAN"
kpl.SetFocus
kpl = ""
End If
End Sub

Private Sub Command7_Click()
Data3.Recordset.Index = "NFJ"
Data3.Recordset.Seek "=", nf.Text
If Data3.Recordset.NoMatch Then
nf.SetFocus
Else
MsgBox "FAKTUR SUDAH DIKENAL! MAU LIHAT?", vbInformation, "PERINGATAN"
kp.Text = Data3.Recordset!KD_PRODUK
kp.Enabled = False
kpl.Text = Data3.Recordset!KD_PELANGGAN
kpl.Enabled = False
hj.Text = Data3.Recordset!HARGA
hj.Enabled = False
jj.Text = Data3.Recordset!BANYAK
jj.Enabled = False
jp.Text = Data2.Recordset!SATUAN
jp.Enabled = False
tgl.Text = Data3.Recordset!TANGGAL
tgl.Enabled = False
hj.Enabled = False
Command2.Enabled = False
Command6.Enabled = False
Command1.Enabled = False
Command3.Enabled = True
Command4.SetFocus
End If
End Sub

Private Sub jj_Change()
Command2.Enabled = True
tot.Text = Val(jj.Text) * Val(hj.Text)
End Sub

Private Sub kp_keypress(keyascii As Integer)
If keyascii = 13 Then
Data2.Recordset.Index = "KDP"
Data2.Recordset.Seek "=", kp.Text
If Data2.Recordset.NoMatch Then
MsgBox "DATA PRODUK TIDAK DIKENAL", vbInformation, "PERINGATAN"
kp.SetFocus
kp = ""
Else
jj.SetFocus
hj.Text = Data2.Recordset!HARGA + Data2.Recordset!HARGA * 0.5
jp.Text = Data2.Recordset!SATUAN
End If
End If
End Sub

Private Sub kpl_keypress(keyascii As Integer)
If keyascii = 13 Then
Data1.Recordset.Index = "KDPL"
Data1.Recordset.Seek "=", kpl.Text
If Data1.Recordset.NoMatch Then
MsgBox "DATA PELANGGAN TIDAK DIKENAL", vbInformation, "PERINGATAN"
kpl.SetFocus
kpl = ""
End If
End If
End Sub

Private Sub nf_keypress(keyascii As Integer)
If keyascii = 13 Then
Data3.Recordset.Index = "NFJ"
Data3.Recordset.Seek "=", nf.Text
If Data3.Recordset.NoMatch Then
MsgBox "FAKTUR PENJUALAN TIDAK DIKENAL", vbInformation, "PERINGATAN"
nf = ""
nf.SetFocus
Else
MsgBox "FAKTUR SUDAH DIKENAL! MAU LIHAT?", vbInformation, "PERINGATAN"
kp.Text = Data3.Recordset!KD_PRODUK
kp.Enabled = False
kpl.Text = Data3.Recordset!KD_PELANGGAN
kpl.Enabled = False
hj.Text = Data3.Recordset!HARGA
hj.Enabled = False
jj.Text = Data3.Recordset!BANYAK
jj.Enabled = False
jp.Text = Data2.Recordset!SATUAN
jp.Enabled = False
tgl.Text = Data3.Recordset!TANGGAL
hj.Enabled = False
tgl.Enabled = False
Command2.Enabled = False
Command6.Enabled = False
Command1.Enabled = False
Command3.Enabled = True
Command4.SetFocus
End If
End If
End Sub


EBELI

Private Sub Command1_Click()
Data2.Recordset.Index = "KDP"
Data2.Recordset.Seek "=", kp.Text
If Data2.Recordset.NoMatch Then
MsgBox "DATA PRODUK TIDAK DIKENAL", vbInformation, "PERINGATAN"
kp.SetFocus
kp = ""
Else
jb.SetFocus
hB.Text = Data2.Recordset!HARGA
jp.Text = Data2.Recordset!SATUAN
End If
End Sub

Private Sub Command2_Click()
Command2.Enabled = False
Data3.Recordset.Index = "NF"
Data3.Recordset.Seek "=", nf.Text
If Data3.Recordset.NoMatch Then
Data3.Recordset.AddNew
Data3.Recordset!NOFAK_BELI = nf.Text
Data3.Recordset!KD_PRODUK = kp.Text
Data3.Recordset!KD_PEMASOK = kpm.Text
Data3.Recordset!BANYAK = Val(jb.Text)
Data3.Recordset!HARGA = hB.Text
Data3.Recordset!TANGGAL = tgl.Text
Data3.Recordset.Update
Else
Data3.Recordset.Edit
Data3.Recordset!NOFAK_BELI = nf.Text
Data3.Recordset!KD_PRODUK = kp.Text
Data3.Recordset!KD_PEMASOK = kpm.Text
Data3.Recordset!BANYAK = Val(jb.Text)
Data3.Recordset!HARGA = hB.Text
Data3.Recordset!TANGGAL = tgl.Text
Data3.Recordset.Update
End If
Data2.Recordset.Edit
Data2.Recordset!SATUAN = Val(jp.Text) + Val(jb.Text)
Data2.Recordset.Update
bersih
mati
End Sub

Private Sub Command3_Click()
Command2.Enabled = True
kp.Enabled = True
kpm.Enabled = True
tgl.Enabled = True
jb.Enabled = True
Command6.Enabled = True
Command1.Enabled = True
Command3.Enabled = False
kp.SetFocus
End Sub

Private Sub Command4_Click()
bersih
mati
End Sub
Private Sub mati()
Command1.Enabled = False
Command6.Enabled = False
kp.Enabled = False
kpm.Enabled = False
jp.Enabled = False
jb.Enabled = False
tgl.Enabled = False
End Sub
Private Sub bersih()
kp = ""
kp.Enabled = True
kpm = ""
kpm.Enabled = True
nf = ""
nf.Enabled = True
jp = ""
tgl.Mask = ""
tgl.Enabled = True
jb = ""
jb.Enabled = True
hB = ""
hB.Enabled = True
nf.SetFocus
Command2.Enabled = False
Command3.Enabled = False
End Sub

Private Sub Command5_Click()
Unload Me
End Sub

Private Sub Command6_Click()
Data1.Recordset.Index = "KDPM"
Data1.Recordset.Seek "=", kpm.Text
If Data1.Recordset.NoMatch Then
MsgBox "DATA PEMASOK TIDAK DIKENAL", vbInformation, "PERINGATAN"
kpm.SetFocus
kpm = ""
End If
End Sub

Private Sub Command7_Click()
Data3.Recordset.Index = "NF"
Data3.Recordset.Seek "=", nf.Text
If Data3.Recordset.NoMatch Then
MsgBox "FAKTUR TIDAK DIKENAL", vbInformation, "PERINGATAN"
nf = ""
nf.SetFocus
Else
MsgBox "PENCARIAN FAKTUR SUDAH KETEMU! MAU LIHAT?", vbInformation, "PERINGATAN"
kp.Text = Data3.Recordset!KD_PRODUK
kp.Enabled = False
kpm.Text = Data3.Recordset!KD_PEMASOK
kpm.Enabled = False
hB.Text = Data3.Recordset!HARGA
hB.Enabled = False
jb.Text = Data3.Recordset!BANYAK
jb.Enabled = False
jp.Text = Data2.Recordset!SATUAN
jp.Enabled = False
tgl.Text = Data3.Recordset!TANGGAL
tgl.Enabled = False
Command2.Enabled = False
Command3.Enabled = True
Command4.SetFocus
End If
End Sub



Private Sub jb_Change()
Command2.Enabled = True
tot.Text = Val(jb.Text) * Val(hB.Text)
End Sub

Private Sub kp_keypress(keyascii As Integer)
If keyascii = 13 Then
Data2.Recordset.Index = "KDP"
Data2.Recordset.Seek "=", kp.Text
If Data2.Recordset.NoMatch Then
MsgBox "DATA PRODUK TIDAK DIKENAL", vbInformation, "PERINGATAN"
kp.SetFocus
kp = ""
Else
jb.SetFocus
hB.Text = Data2.Recordset!HARGA
jp.Text = Data2.Recordset!SATUAN
End If
End If
End Sub

Private Sub kpm_keypress(keyascii As Integer)
If keyascii = 13 Then
Data1.Recordset.Index = "KDPM"
Data1.Recordset.Seek "=", kpm.Text
If Data1.Recordset.NoMatch Then
MsgBox "DATA PEMASOK TIDAK DIKENAL", vbInformation, "PERINGATAN"
kpm.SetFocus
kpm = ""
End If
End If
End Sub

Private Sub nf_keypress(keyascii As Integer)
If keyascii = 13 Then
Data3.Recordset.Index = "NF"
Data3.Recordset.Seek "=", nf.Text
If Data3.Recordset.NoMatch Then
MsgBox "FAKTUR TIDAK DIKENAL", vbInformation, "PERINGATAN"
nf = ""
nf.SetFocus
Else
MsgBox "PENCARIAN FAKTUR SUDAH KETEMU! MAU LIHAT?", vbInformation, "PERINGATAN"
kp.Text = Data3.Recordset!KD_PRODUK
kp.Enabled = False
kpm.Text = Data3.Recordset!KD_PEMASOK
kpm.Enabled = False
hB.Text = Data3.Recordset!HARGA
hB.Enabled = False
jb.Text = Data3.Recordset!BANYAK
jb.Enabled = False
jp.Text = Data2.Recordset!SATUAN
jp.Enabled = False
tgl.Text = Data3.Recordset!TANGGAL
hB.Enabled = False
Command2.Enabled = False
Command3.Enabled = True
Command4.SetFocus
End If
End If
End Sub

CPRODUK

Option Explicit

Private Sub Command1_Click()
Command1.Enabled = False
kp2.Enabled = True
kp2.SetFocus
End Sub

Private Sub Command5_Click()
Unload Me
End Sub

Private Sub kp_Change()
Command1.Enabled = True
End Sub
Private Sub Check1_Click()
If Check1.Value = vbChecked Then
Command1.Enabled = False
Command2.Enabled = True
Command3.Enabled = False
kp.Enabled = True
kp.SetFocus
Else
Command1.Enabled = False
Command2.Enabled = False
Command3.Enabled = True
kp.Enabled = False
kp = ""
kp2.Enabled = False
kp2 = ""
End If
End Sub
Private Sub Command2_Click()
Check1.Value = vbUnchecked
Command1.Enabled = False
End Sub

CPEMAOSK

Option Explicit

Private Sub Command1_Click()
Command1.Enabled = False
kp2.Enabled = True
kp2.SetFocus
End Sub

Private Sub Command5_Click()
Unload Me
End Sub

Private Sub kp_Change()
Command1.Enabled = True
End Sub
Private Sub Check1_Click()
If Check1.Value = vbChecked Then
Command2.Enabled = True
Command3.Enabled = False
Command1.Enabled = False
kp.Enabled = True
kp.SetFocus
Else
Command2.Enabled = False
Command1.Enabled = False
Command3.Enabled = True
kp.Enabled = False
kp = ""
kp2.Enabled = False
kp2 = ""
End If
End Sub
Private Sub Command2_Click()
Check1.Value = vbUnchecked
Command1.Enabled = False
End Sub

CPELANGGAAN

Option Explicit

Private Sub Command1_Click()
Command1.Enabled = False
kp2.Enabled = True
kp2.SetFocus
End Sub

Private Sub Command5_Click()
Unload Me
End Sub

Private Sub kp_Change()
Command1.Enabled = True
End Sub
Private Sub Check1_Click()
If Check1.Value = vbChecked Then
Command2.Enabled = True
Command3.Enabled = False
Command1.Enabled = False
kp.Enabled = True
kp.SetFocus
Else
Command2.Enabled = False
Command1.Enabled = False
Command3.Enabled = True
kp.Enabled = False
kp = ""
kp2.Enabled = False
kp2 = ""
End If
End Sub
Private Sub Command2_Click()
Check1.Value = vbUnchecked
Command1.Enabled = False
End Sub

CJUAL

Option Explicit

Private Sub Command1_Click()
Command1.Enabled = False
kp2.Enabled = True
kp2.SetFocus
End Sub



Private Sub Command5_Click()
Unload Me
End Sub

Private Sub kp0_Change()
Command1.Enabled = True
End Sub
Private Sub Check1_Click()
If Check1.Value = vbChecked Then
Command1.Enabled = False
Command2.Enabled = True
Command3.Enabled = False
kp0.Enabled = True
kp0.SetFocus
Else
Command1.Enabled = False
Command2.Enabled = False
Command3.Enabled = True
kp0.Enabled = False
kp0 = ""
kp2.Enabled = False
kp2 = ""
End If
End Sub
Private Sub Command2_Click()
Check1.Value = vbUnchecked
Command1.Enabled = False
End Sub

CBELI

Option Explicit

Private Sub Check1_Click()
If Check1.Value = vbChecked Then
Command2.Enabled = True
Command3.Enabled = False
Command1.Enabled = False
kp.Enabled = True
kp.SetFocus
Else
Command2.Enabled = False
Command1.Enabled = False
Command3.Enabled = True
kp.Enabled = False
kp = ""
kp2.Enabled = False
kp2 = ""
End If
End Sub

Private Sub Command1_Click()
Command1.Enabled = False
kp2.Enabled = True
kp2.SetFocus
End Sub

Private Sub Command2_Click()
Check1.Value = vbUnchecked
Command1.Enabled = False
End Sub

Private Sub Command5_Click()
Unload Me
End Sub

Private Sub kp_Change()
Command1.Enabled = True
End Sub