248
DataGrid2.Refresh End If
End Sub Private Sub txtCari_KeyPressKeyAscii As Integer
KeyAscii = AscUCaseChrKeyAscii End Sub
Private Sub txtNamaSuplier_keypressKeyAscii As Integer KeyAscii = AscUCaseChrKeyAscii
End Sub Private Sub txtalamat_keypressKeyAscii As Integer
KeyAscii = AscUCaseChrKeyAscii End Sub
R. Form Pengolahan Data Suplier Operator
Sub formKosong txtNamaSuplier.Text =
txtAlamat.Text = End Sub
Sub formAktif txtNamaSuplier.Enabled = True
txtAlamat.Enabled = True End Sub
Sub formNonAktif txtNamaSuplier.Enabled = False
txtAlamat.Enabled = False End Sub
Sub formAwal cmdTambah.Enabled = True
cmdSimpan.Enabled = False cmdBatal.Enabled = False
cmdKeluar.Enabled = True End Sub
Private Sub cmdBatal_Click Call formKosong
Call formNonAktif Call formAwal
End Sub Private Sub cmdKeluar_Click
Unload Me End Sub
Private Sub cmdSimpan_Click menampilkan data suplier berdasarkan nama_suplier
Call konekDB rsSuplier.Open select from suplier where _
nama_suplier = TrimtxtNamaSuplier.Text , _ koneksi, adOpenDynamic, adLockBatchOptimistic
Adodc2.Refresh DataGrid2.Refresh
If txtNamaSuplier.Text = Then konfirmasi jiga nama suplier masih dalam keadaan kosong
MsgBox Isi Nama Suplier, vbOKOnly + vbCritical, Gagal txtNamaSuplier.SetFocus
249
ElseIf Not rsSuplier.EOF Then konfirmasi nama suplier sudah ada
MsgBox Maaf, Nama Suplier _ UCasetxtNamaSuplier.Text _
telah tersedia, _ vbInformation + vbOKOnly, Informasi
koneksi.Close txtNamaSuplier.Text =
txtNamaSuplier.SetFocus Exit Sub
Else perintah SQL untuk menyimpan data ke dalam tabel suplier
koneksi.Close Call konekDB
sql = sql = CALL id_suplier txtNamaSuplier.Text , _
txtAlamat.Text koneksi.Execute sql, , adCmdText
Adodc2.Refresh DataGrid2.Refresh
MsgBox Data berhasil ditambahkan, vbInformation, Berhasil Call formKosong
Call formNonAktif Call formAwal
End If Adodc2.Refresh
DataGrid2.Refresh Adodc2.RecordSource = select id_suplier KODE SUPLIER, nama_suplier NAMA
SUPLIER, alamat ALAMAT from suplier order by id_suplier koneksi.Close
End Sub Private Sub cmdTambah_Click
Call formKosong Call formAktif
txtNamaSuplier.SetFocus cmdTambah.Enabled = False
cmdSimpan.Enabled = True cmdBatal.Enabled = True
cmdKeluar.Enabled = False End Sub
Private Sub Form_Load Call formNonAktif
Call formAwal With boxKategori
.AddItem KODE SUPLIER .AddItem NAMA SUPLIER
End With End Sub
Private Sub Form_UnloadCancel As Integer Do Until Me.Top = -9000
DoEvents Me.Move Me.Left, Me.Top - 50
250
DoEvents Loop
End Sub Private Sub txtCari_chenge
KeyAscii = AscUCaseChrKeyAscii If boxKategori.Text = KODE SUPLIER Then
Adodc2.RecordSource = select id_suplier KODE SUPLIER, nama_suplier NAMA SUPLIER, alamat ALAMAT from suplier where id_suplier LIKE _
txtCari.Text order by id_suplier Adodc2.Refresh
DataGrid2.Refresh Else
Adodc2.RecordSource = select id_suplier KODE SUPLIER, nama_suplier NAMA SUPLIER, alamat ALAMAT from suplier where nama_suplier LIKE _
txtCari.Text order by id_suplier Adodc2.Refresh
DataGrid2.Refresh End If
End Sub Private Sub txtCari_Change
If boxKategori.Text = KODE SUPLIER Then Adodc2.RecordSource = select id_suplier KODE SUPLIER, nama_suplier NAMA
SUPLIER, alamat ALAMAT from suplier where id_suplier LIKE _ txtCari.Text order by id_suplier
Adodc2.Refresh DataGrid2.Refresh
Else Adodc2.RecordSource = select id_suplier KODE SUPLIER, nama_suplier NAMA
SUPLIER, alamat ALAMAT from suplier where nama_suplier LIKE _ txtCari.Text order by id_suplier
Adodc2.Refresh DataGrid2.Refresh
End If End Sub
Private Sub txtCari_KeyPressKeyAscii As Integer KeyAscii = AscUCaseChrKeyAscii
End Sub Private Sub txtNamaSuplier_keypressKeyAscii As Integer
KeyAscii = AscUCaseChrKeyAscii End Sub
Private Sub txtalamat_keypressKeyAscii As Integer KeyAscii = AscUCaseChrKeyAscii
End Sub
S. Form Pengolahan Jenis Barang Inventaris