VERSION 5.00
Begin VB.Form CariBarang 
   BackColor       =   &H00C0E0FF&
   Caption         =   "Form1"
   ClientHeight    =   2145
   ClientLeft      =   165
   ClientTop       =   555
   ClientWidth     =   5595
   LinkTopic       =   "Form1"
   MDIChild        =   -1  'True
   ScaleHeight     =   2145
   ScaleWidth      =   5595
   WindowState     =   2  'Maximized
   Begin VB.TextBox txtJumlahBarang 
      Appearance      =   0  'Flat
      Enabled         =   0   'False
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   285
      Left            =   1800
      TabIndex        =   3
      Top             =   1320
      Width           =   2055
   End
   Begin VB.TextBox txtHargaBarang 
      Appearance      =   0  'Flat
      Enabled         =   0   'False
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   285
      Left            =   1800
      TabIndex        =   2
      Top             =   960
      Width           =   2175
   End
   Begin VB.TextBox txtNamaBarang 
      Appearance      =   0  'Flat
      Enabled         =   0   'False
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   285
      Left            =   1800
      TabIndex        =   1
      Top             =   600
      Width           =   3255
   End
   Begin VB.TextBox txtKodeBarang 
      Appearance      =   0  'Flat
      Enabled         =   0   'False
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   285
      Left            =   1800
      TabIndex        =   0
      Top             =   240
      Width           =   2055
   End
   Begin VB.Label Label4 
      Appearance      =   0  'Flat
      BackColor       =   &H00C0E0FF&
      Caption         =   "Jumlah Barang"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000008&
      Height          =   255
      Left            =   360
      TabIndex        =   7
      Top             =   1320
      Width           =   1455
   End
   Begin VB.Label Label3 
      Appearance      =   0  'Flat
      BackColor       =   &H00C0E0FF&
      Caption         =   "Harga Barang"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000008&
      Height          =   255
      Left            =   360
      TabIndex        =   6
      Top             =   960
      Width           =   1455
   End
   Begin VB.Label Label2 
      Appearance      =   0  'Flat
      BackColor       =   &H00C0E0FF&
      Caption         =   "Nama Barang"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000008&
      Height          =   255
      Left            =   360
      TabIndex        =   5
      Top             =   600
      Width           =   1455
   End
   Begin VB.Label Label1 
      Appearance      =   0  'Flat
      BackColor       =   &H00C0E0FF&
      Caption         =   "Kode Barang"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000008&
      Height          =   255
      Left            =   360
      TabIndex        =   4
      Top             =   240
      Width           =   1455
   End
   Begin VB.Menu mnu_cari_barang 
      Caption         =   "Cari Barang"
   End
   Begin VB.Menu mnu_kluar 
      Caption         =   "Keluar"
   End
End
Attribute VB_Name = "CariBarang"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim conAVB As ADODB.Connection
Dim rsBarang As ADODB.Recordset

Private Sub Form_Load()
    Dim strSQL As String
  Set conAVB = New ADODB.Connection
    conAVB.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
    "Persist Security info=False;Data source =" & App.Path & _
    "\AVB.mdb;mode = readwrite"
    conAVB.Open
  Set rsBarang = New ADODB.Recordset
  strSQL = "SELECT * FROM Barang"
    rsBarang.Open strSQL, conAVB, adOpenDynamic, adLockOptimistic, adCmdText
End Sub

Private Sub mnu_cari_barang_Click()
  On Error Resume Next
  Dim strKode, strCari As String
  strKode = InputBox("Masukkan Kode Barang Yang Akan anda Cari.", "Cari Data Barang")
  strCari = "[Kode Barang] = '" & strKode & "'"
  With rsBarang
    .MoveFirst
    .Find strCari
    If .EOF Then MsgBox "Kode Tidak Ada", vbExclamation, "Perhatian"
    TampilkanData
  End With
End Sub

Private Sub mnu_kluar_Click()
  Unload Me
End Sub

Private Sub TampilkanData()
  With rsBarang
    txtKodeBarang.Text = ![Kode Barang]
    txtNamaBarang.Text = ![Nama Barang]
    txtHargaBarang.Text = ![Harga Barang]
    txtJumlahBarang.Text = ![Jumlah Barang]
  End With
End Sub
