Private Sub Form_Load()
Call OPENDB
Call hapus
End Sub
Private Sub kd_produk_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If kd_produk.Text = "" Then
MsgBox "Masukkan kd_produk produk !", vbInformation, "produk"
kd_produk.SetFocus
Exit Sub
End If
SQL = "SELECT * FROM produk WHERE kd_produk='" & kd_produk.Text & "'"
If RS.State = adStateOpen Then RS.Close
RS.Open SQL, Db, adOpenDynamic, adLockOptimistic
If RS.RecordCount <> 0 Then
Tampilproduk
Call RubahCMD(Me, False, True, True, True)
cmdproses(1).Caption = "&Edit"
kd_produk.Enabled = False
Else
x = kd_produk.Text
Call hapus
kd_produk.Text = x
Call RubahCMD(Me, False, True, False, True)
cmdproses(1).Caption = "&baru"
End If
nama.SetFocus
End If
End Sub
Tidak ada komentar:
Posting Komentar