Jumat, 04 November 2011

Latihan 33 Apkom 4 D3 B

49 komentar:

  1. Public Class LATIHAN033B36109038
    Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\DATABARANG.accdb;Jet OLEDB:Database Password=icha")
    Dim cari As New ByIskandar.CariKeDataBaseByIskandar

    Private Sub Button136109038_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button136109038.Click
    If t136109038.Text.Length = 0 Then
    MsgBox("kode barang belum terisi")
    Exit Sub
    End If

    If t236109038.Text.Length = 0 Then
    MsgBox("nama barang belum terisi")
    Exit Sub
    End If

    If Val(t336109038.Text) = 0 Then
    MsgBox("harga jual belum diisi")
    Exit Sub
    End If

    If Val(t436109038.Text) = 0 Then
    MsgBox("jumlah barang")
    Exit Sub
    End If

    cari.AturPencarianDataBase("barang", "kodebarang", t136109038.Text, 1, conect)

    If cari.JumlanBaris > 0 Then
    MsgBox("kode sudah ada")
    Exit Sub
    End If


    Dim com As New OleDb.OleDbCommand
    com = New OleDb.OleDbCommand("insert into barang(kodebarang,namabarang,hargajual,jumlahbarang) Values('" & t136109038.Text & "','" & t236109038.Text & "'," & Val(t336109038.Text) & "," & Val(t436109038.Text) & ")", conect)

    conect.Open()
    com.ExecuteNonQuery()
    conect.Close()
    com.Dispose()

    t136109038.Text = ""
    t236109038.Text = ""
    t336109038.Text = ""
    t436109038.Text = ""

    LATIHAN033A36109038.Icha()
    End Sub
    End Class

    BalasHapus
  2. Public Class Latihan33A36109046
    Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;Jet OLEDB:Database Password=14322836")
    Dim cari As New DataTable
    Public Sub zaza()
    Dim adap As New OleDb.OleDbDataAdapter
    adap = New OleDb.OleDbDataAdapter("select * from barang", conect)
    cari.Rows.Clear()
    adap.Fill(cari)
    adap.Dispose()
    End Sub
    Private Sub Latihan33A36109046_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    zaza()
    DataGridView136109046.DataSource = cari
    End Sub
    Private Sub Button236109046_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button236109046.Click
    If Latihan33B36109046.Visible = False Then
    Latihan33B36109046.Show()
    Else
    Latihan33B36109046.Activate()
    End If
    End Sub
    Private Sub Button136109046_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button136109046.Click
    If Latihan33B36109046.Visible = False Then
    Latihan33B36109046.Show()
    Else
    Latihan33B36109046.Activate()
    End If
    Latihan33B36109046.KB.Text = DataGridView136109046.CurrentRow.Cells("KODEBARANG").Value
    Latihan33B36109046.t136109046.Text = DataGridView136109046.CurrentRow.Cells("KODEBARANG").Value
    Latihan33B36109046.t236109046.Text = DataGridView136109046.CurrentRow.Cells("NAMABARANG").Value
    Latihan33B36109046.t336109046.Text = DataGridView136109046.CurrentRow.Cells("HARGAJUAL").Value
    Latihan33B36109046.t436109046.Text = DataGridView136109046.CurrentRow.Cells("JUMLAHBARANG").Value
    End Sub
    Private Sub Button336109046_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button336109046.Click
    Dim ZAHRAH As New OleDb.OleDbCommand
    ZAHRAH = New OleDb.OleDbCommand("DELETE * FROM BARANG WHERE KODEBARANG='" & DataGridView136109046.CurrentRow.Cells("KODEBARANG").Value & "'", conect)
    conect.Open()
    ZAHRAH.ExecuteNonQuery()
    conect.Close()
    ZAHRAH.Dispose()
    zaza()
    End Sub
    End Class

    BalasHapus
  3. Public Class Latihan33B36109046
    Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;Jet OLEDB:Database Password=14322836")
    Dim cari As New ByIskandar.CariKeDataBaseByIskandar
    Private Sub Button136109046_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button136109046.Click
    If t136109046.Text.Length = 0 Then
    MsgBox("kode barang belum terisi")
    Exit Sub
    End If
    If t236109046.Text.Length = 0 Then
    MsgBox("nama barang belum terisi")
    Exit Sub
    End If
    If Val(t336109046.Text) = 0 Then
    MsgBox("harga jual belum diisi")
    Exit Sub
    End If
    If Val(t436109046.Text) = 0 Then
    MsgBox("jumlah barang")
    Exit Sub
    End If
    cari.AturPencarianDataBase("barang", "kodebarang", t136109046.Text, 1, conect)
    If cari.JumlanBaris > 0 Then
    MsgBox("kode sudah ada")
    Exit Sub
    End If
    Dim com As New OleDb.OleDbCommand
    com = New OleDb.OleDbCommand("insert into barang(kodebarang,namabarang,hargajual,jumlahbarang) Values('" & t136109046.Text & "','" & t236109046.Text & "'," & Val(t336109046.Text) & "," & Val(t436109046.Text) & ")", conect)
    conect.Open()
    com.ExecuteNonQuery()
    conect.Close()
    com.Dispose()
    t136109046.Text = ""
    t236109046.Text = ""
    t336109046.Text = ""
    t436109046.Text = ""
    Latihan33A36109046.zaza()
    End Sub
    End Class

    BalasHapus
  4. Public Class Latih33A_36109034
    Dim conect As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\databarang.accdb;jet OLEDB:database password=nhunoe")
    Dim nhunoe As New DataTable
    Dim angkut As New OleDb.OleDbCommand
    Dim cobaji As New OleDb.OleDbDataAdapter
    Private Sub latihan153619034_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    cobaji = New OleDb.OleDbDataAdapter("select * from barang", conect)
    cobaji.Fill(nhunoe)
    DataGridView1.DataSource = nhunoe
    End Sub
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    If Latih33B_36109034.Visible = False Then
    Latih33B_36109034.Show()
    Else
    Latih33B_36109034.Activate()
    End If
    Latih33B_36109034.ToolStripStatusLabel1.Text = DataGridView1.CurrentRow.Cells("KodeBarang").Value
    Latih33B_36109034.t1.Text = DataGridView1.CurrentRow.Cells("KodeBarang").Value
    Latih33B_36109034.t2.Text = DataGridView1.CurrentRow.Cells("NamaBarang").Value
    Latih33B_36109034.t3.Text = DataGridView1.CurrentRow.Cells("Hargajual").Value
    Latih33B_36109034.t4.Text = DataGridView1.CurrentRow.Cells("jumlahbarang").Value
    End Sub
    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
    Dim noe As String = "delete * from barang where kodebarang = '" & DataGridView1.CurrentRow.Cells("kodebarang").Value & "'"
    angkut = New OleDb.OleDbCommand(noe, conect)
    conect.Open()
    angkut.ExecuteNonQuery()
    conect.Close()
    angkut.Dispose()
    cobaji = New OleDb.OleDbDataAdapter("select * from barang", conect)
    cobaji.Fill(nhunoe)
    DataGridView1.DataSource = nhunoe
    End Sub
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
    If Latih33B_36109034.Visible = False Then
    Latih33B_36109034.Show()
    Else
    Latih33B_36109034.Activate()
    End If
    End Sub
    End Class

    BalasHapus
  5. Public Class Latih33B_36109034
    Dim cari As New ByIskandar.CariKeDataBaseByIskandar
    Dim conect As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & Application.StartupPath & "\DATABARANG.accdb;jet OLEDB:database password=nhunoe")
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    If ToolStripStatusLabel1.Text = "KODE BARANG LAMA" Then
    cari.AturPencarianDataBase("Barang", "KodeBarang", t1.Text, 1, conect)
    yaya()
    Dim com As New OleDb.OleDbCommand
    com = New OleDb.OleDbCommand("insert into BARANG (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & t1.Text & "','" & t2.Text & "'," & Val(t3.Text) & "," & Val(t4.Text) & ")", conect)
    conect.Open()
    com.ExecuteNonQuery()
    conect.Close()
    com.Dispose()

    t1.Text = ""
    t2.Text = ""
    t3.Text = ""
    t4.Text = ""
    Else
    If ToolStripStatusLabel1.Text <> t1.Text Then
    cari.AturPencarianDataBase("Barang", "KodeBarang", t1.Text, 1, conect)
    yaya()
    End If
    Dim com As New OleDb.OleDbCommand
    com = New OleDb.OleDbCommand("UPDATE BARANG SET kodebarang = '" & t1.Text & "', namabarang = '" & t2.Text & "', hargajual = " & Val(t3.Text) & ", jumlahbarang = " & Val(t4.Text) & " where kodebarang ='" & ToolStripStatusLabel1.Text & "'", conect)

    conect.Open()
    com.ExecuteNonQuery()
    conect.Close()
    com.Dispose()

    t1.Text = ""
    t2.Text = ""
    t3.Text = ""
    t4.Text = ""
    End If
    End Sub
    Public Sub yaya()
    If cari.JumlanBaris > 0 Then
    MsgBox("kode barang telah ada")
    t1.Text = ""
    Exit Sub
    ElseIf t1.Text.Length = 0 Then
    MsgBox("kode barang harus tercantum")
    Exit Sub
    ElseIf t2.Text.Length = 0 Then
    MsgBox("nama barang harus tercantum")
    Exit Sub
    ElseIf t3.Text.Length = 0 Then
    MsgBox("harga jual harus tercantum")
    Exit Sub
    ElseIf t3.Text.Length = 0 Then
    MsgBox("jumlah barang harus tercantum")
    Exit Sub
    End If
    End Sub
    End Class

    BalasHapus
  6. Komentar ini telah dihapus oleh pengarang.

    BalasHapus
  7. Komentar ini telah dihapus oleh pengarang.

    BalasHapus
  8. Komentar ini telah dihapus oleh pengarang.

    BalasHapus
  9. Public Class LATIHAN33B36109044
    Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;Jet OLEDB:Database Password=magfirah")
    Dim firah As New ByIskandar.CariKeDataBaseByIskandar

    Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
    If t136109044.Text.Length = 0 Then
    MsgBox("kode barang belum terisi")
    Exit Sub
    End If

    If t236109044.Text.Length = 0 Then
    MsgBox("nama barang belum terisi")
    Exit Sub
    End If

    If Val(t336109044.Text) = 0 Then
    MsgBox("harga jual belum diisi")
    Exit Sub
    End If

    If Val(t436109044.Text) = 0 Then
    MsgBox("jumlah barang")
    Exit Sub
    End If

    firah.AturPencarianDataBase("barang", "kodebarang", t136109044.Text, 1, conect)

    If firah.JumlanBaris > 0 Then
    MsgBox("kode sudah ada")
    Exit Sub
    End If


    Dim com As New OleDb.OleDbCommand
    com = New OleDb.OleDbCommand("insert into barang(kodebarang,namabarang,hargajual,jumlahbarang) Values('" & t136109044.Text & "','" & t236109044.Text & "'," & Val(t336109044.Text) & "," & Val(t436109044.Text) & ")", conect)

    conect.Open()
    com.ExecuteNonQuery()
    conect.Close()
    com.Dispose()

    t136109044.Text = ""
    t236109044.Text = ""
    t336109044.Text = ""
    t436109044.Text = ""

    LATIHAN33A36109044.magfirah()
    End Sub
    End Class

    BalasHapus
  10. Public Class LATIHAN033B36109032

    Dim misal As New ByIskandar.CariKeDataBaseByIskandar
    Dim sambung As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & Application.StartupPath & "\DATABARANG.accdb;Jet OLEDB:Database Password=jayapura")

    Private Sub Button136109032_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button136109032.Click
    If ToolStripStatusLabel1.Text = "KODE BARANG LAMA" Then
    misal.AturPencarianDataBase("Barang", "KodeBarang", T136109032.Text, 1, sambung)
    speaker()
    Dim com As New OleDb.OleDbCommand
    com = New OleDb.OleDbCommand("insert into BARANG (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & T136109032.Text & "','" & T236109032.Text & "'," & Val(T336109032.Text) & "," & Val(T436109032.Text) & ")", sambung)
    sambung.Open()
    com.ExecuteNonQuery()
    sambung.Close()
    com.Dispose()

    T136109032.Text = ""
    T236109032.Text = ""
    T336109032.Text = ""
    T436109032.Text = ""
    Else
    If ToolStripStatusLabel1.Text <> T136109032.Text Then
    misal.AturPencarianDataBase("Barang", "KodeBarang", T136109032.Text, 1, sambung)
    speaker()

    End If
    Dim com As New OleDb.OleDbCommand
    com = New OleDb.OleDbCommand("UPDATE BARANG SET kodebarang = '" & T136109032.Text & "', namabarang = '" & T236109032.Text & "', hargajual = " & Val(T336109032.Text) & ", jumlahbarang = " & Val(T436109032.Text) & " where kodebarang ='" & ToolStripStatusLabel1.Text & "'", sambung)

    sambung.Open()
    com.ExecuteNonQuery()
    sambung.Close()
    com.Dispose()

    T136109032.Text = ""
    T236109032.Text = ""
    T336109032.Text = ""
    T436109032.Text = ""
    End If
    End Sub

    Public Sub speaker()
    If misal.JumlanBaris > 0 Then
    MsgBox("kode barang telah ada")
    T136109032.Text = ""
    Exit Sub
    ElseIf T136109032.Text.Length = 0 Then
    MsgBox("kode barang harus tercantum")
    Exit Sub
    ElseIf T236109032.Text.Length = 0 Then
    MsgBox("nama barang harus tercantum")
    Exit Sub
    ElseIf T336109032.Text.Length = 0 Then
    MsgBox("harga jual harus tercantum")
    Exit Sub
    ElseIf T336109032.Text.Length = 0 Then
    MsgBox("jumlah barang harus tercantum")
    Exit Sub
    End If

    End Sub
    End Class

    BalasHapus
  11. Public Class LATIHAN_033A_36109056
    Dim conect As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\databarang.accdb;jet OLEDB:database password=2422")
    Dim hasbiya As New DataTable
    Dim antara As New OleDb.OleDbCommand
    Dim cobaji As New OleDb.OleDbDataAdapter
    Private Sub LATIHAN033A012_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    cobaji = New OleDb.OleDbDataAdapter("select * from barang", conect)
    cobaji.Fill(hasbiya)
    DataGridView1.DataSource = hasbiya
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    If LATIHAN_033B_36109056.Visible = False Then
    LATIHAN_033B_36109056.Show()
    Else
    LATIHAN_033B_36109056.Activate()
    End If
    LATIHAN_033B_36109056.ToolStripStatusLabel1.Text = DataGridView1.CurrentRow.Cells("KodeBarang").Value
    LATIHAN_033B_36109056.t1_36109056.Text = DataGridView1.CurrentRow.Cells("KodeBarang").Value
    LATIHAN_033B_36109056.t2_36109056.Text = DataGridView1.CurrentRow.Cells("NamaBarang").Value
    LATIHAN_033B_36109056.t3_36109056.Text = DataGridView1.CurrentRow.Cells("Hargajual").Value
    LATIHAN_033B_36109056.t4_36109056.Text = DataGridView1.CurrentRow.Cells("jumlahbarang").Value
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
    If LATIHAN_033B_36109056.Visible = False Then
    LATIHAN_033B_36109056.Show()
    Else
    LATIHAN_033B_36109056.Activate()
    End If
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
    Dim biya As String = "delete * from barang where kodebarang = '" & DataGridView1.CurrentRow.Cells("kodebarang").Value & "'"
    antara = New OleDb.OleDbCommand(biya, conect)
    conect.Open()
    antara.ExecuteNonQuery()
    conect.Close()
    antara.Dispose()
    cobaji = New OleDb.OleDbDataAdapter("select * from barang", conect)
    cobaji.Fill(hasbiya)
    DataGridView1.DataSource = hasbiya
    End Sub
    End Class

    BalasHapus
  12. Public Class LATIHAN_033B_36109056
    Dim conect As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & Application.StartupPath & "\DATABARANG.accdb;jet OLEDB:database password=2422")
    Dim antara As New OleDb.OleDbCommand
    Dim cari As New ByIskandar.CariKeDataBaseByIskandar

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    If ToolStripStatusLabel1.Text = "KODE BARANG LAMA" Then
    cari.AturPencarianDataBase("Barang", "KodeBarang", t1_36109056.Text, 1, conect)
    kha()
    Dim com As New OleDb.OleDbCommand
    com = New OleDb.OleDbCommand("insert into BARANG (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & t1_36109056.Text & "','" & t2_36109056.Text & "'," & Val(t3_36109056.Text) & "," & Val(t4_36109056.Text) & ")", conect)
    conect.Open()
    com.ExecuteNonQuery()
    conect.Close()
    com.Dispose()

    t1_36109056.Text = ""
    t2_36109056.Text = ""
    t3_36109056.Text = ""
    t4_36109056.Text = ""
    Else
    If ToolStripStatusLabel1.Text <> t1_36109056.Text Then
    cari.AturPencarianDataBase("Barang", "KodeBarang", t1_36109056.Text, 1, conect)
    kha()

    End If
    Dim com As New OleDb.OleDbCommand
    com = New OleDb.OleDbCommand("UPDATE BARANG SET kodebarang = '" & t1_36109056.Text & "', namabarang = '" & t2_36109056.Text & "', hargajual = " & Val(t3_36109056.Text) & ", jumlahbarang = " & Val(t4_36109056.Text) & " where kodebarang ='" & ToolStripStatusLabel1.Text & "'", conect)

    conect.Open()
    com.ExecuteNonQuery()
    conect.Close()
    com.Dispose()

    t1_36109056.Text = ""
    t2_36109056.Text = ""
    t3_36109056.Text = ""
    t4_36109056.Text = ""
    End If
    End Sub
    Public Sub kha()
    If cari.JumlanBaris > 0 Then
    MsgBox("kode barang telah ada")
    t1_36109056.Text = ""
    Exit Sub
    ElseIf t1_36109056.Text.Length = 0 Then
    MsgBox("kode barang harus tercantum")
    Exit Sub
    ElseIf t2_36109056.Text.Length = 0 Then
    MsgBox("nama barang harus tercantum")
    Exit Sub
    ElseIf t3_36109056.Text.Length = 0 Then
    MsgBox("harga jual harus tercantum")
    Exit Sub
    ElseIf t3_36109056.Text.Length = 0 Then
    MsgBox("jumlah barang harus tercantum")
    Exit Sub
    End If
    End Sub
    End Class

    BalasHapus
  13. Public Class LATIHAN33A36109044
    Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;Jet OLEDB:Database Password=magfirah")
    Dim firah As New DataTable

    Public Sub magfirah()
    Dim mula As New OleDb.OleDbDataAdapter
    mula = New OleDb.OleDbDataAdapter("select * from barang", conect)
    firah.Rows.Clear()
    mula.Fill(firah)
    mula.Dispose()

    End Sub


    Private Sub LATIHAN033A36109038_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
    magfirah()
    DataGridView1.DataSource = firah
    End Sub


    Private Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
    If LATIHAN33B36109044.Visible = False Then
    LATIHAN33B36109044.Show()
    Else
    LATIHAN33B36109044.Activate()
    End If
    End Sub


    Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
    If LATIHAN33B36109044.Visible = False Then
    LATIHAN33B36109044.Show()
    Else
    LATIHAN33B36109044.Activate()
    End If

    LATIHAN33B36109044.KB.Text = DataGridView1.CurrentRow.Cells("KODEBARANG").Value
    LATIHAN33B36109044.t136109044.Text = DataGridView1.CurrentRow.Cells("KODEBARANG").Value
    LATIHAN33B36109044.t236109044.Text = DataGridView1.CurrentRow.Cells("NAMABARANG").Value
    LATIHAN33B36109044.t336109044.Text = DataGridView1.CurrentRow.Cells("HARGAJUAL").Value
    LATIHAN33B36109044.t436109044.Text = DataGridView1.CurrentRow.Cells("JUMLAHBARANG").Value
    End Sub


    Private Sub Button3_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button3.Click
    Dim warni As New OleDb.OleDbCommand
    warni = New OleDb.OleDbCommand("DELETE * FROM BARANG WHERE KODEBARANG='" & DataGridView1.CurrentRow.Cells("KODEBARANG").Value & "'", conect)
    conect.Open()
    warni.ExecuteNonQuery()
    conect.Close()
    warni.Dispose()

    magfirah()

    End Sub
    End Class

    BalasHapus
  14. Public Class LATIHAN033A36109033

    Dim CONECT As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;Jet OLEDB:Database Password=tahir")
    Dim Browse As New DataTable

    Public Sub pratiwi()
    Dim tiwi As New OleDb.OleDbDataAdapter
    tiwi = New OleDb.OleDbDataAdapter("select * from barang", CONECT)
    Browse.Rows.Clear()
    tiwi.Fill(Browse)
    tiwi.Dispose()

    End Sub

    Private Sub LATIHAN033A36109033_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    pratiwi()
    DataGridView1.DataSource = Browse
    End Sub

    Private Sub Button236109033_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button236109033.Click
    If LATIHAN033B36109033.Visible = False Then
    LATIHAN033B36109033.Show()
    Else
    LATIHAN033B36109033.Activate()
    End If
    End Sub

    Private Sub Button136109033_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button136109033.Click
    If LATIHAN033B36109033.Visible = False Then
    LATIHAN033B36109033.Show()
    Else
    LATIHAN033B36109033.Activate()
    End If

    LATIHAN033B36109033.KB.Text = DataGridView1.CurrentRow.Cells("KODEBARANG").Value
    LATIHAN033B36109033.t136109033.Text = DataGridView1.CurrentRow.Cells("KODEBARANG").Value
    LATIHAN033B36109033.t236109033.Text = DataGridView1.CurrentRow.Cells("NAMABARANG").Value
    LATIHAN033B36109033.t336109033.Text = DataGridView1.CurrentRow.Cells("HARGAJUAL").Value
    LATIHAN033B36109033.t436109033.Text = DataGridView1.CurrentRow.Cells("JUMLAHBARANG").Value

    End Sub

    Private Sub Button336109033_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button336109033.Click
    Dim tahir As New OleDb.OleDbCommand
    tahir = New OleDb.OleDbCommand("DELETE * FROM BARANG WHERE KODEBARANG='" & DataGridView1.CurrentRow.Cells("KODEBARANG").Value & "'", CONECT)
    CONECT.Open()
    tahir.ExecuteNonQuery()
    CONECT.Close()
    tahir.Dispose()

    pratiwi()

    End Sub
    End Class

    BalasHapus
  15. Public Class LATIHAN033B36109033
    Dim CONECT As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;Jet OLEDB:Database Password=tahir")
    Dim browse As New ByIskandar.CariKeDataBaseByIskandar

    Private Sub Button136109033_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button136109033.Click

    If t136109033.Text.Length = 0 Then
    MsgBox("kode barang belum terisi")
    Exit Sub
    End If

    If t236109033.Text.Length = 0 Then
    MsgBox("nama barang belum terisi")
    Exit Sub
    End If

    If Val(t336109033.Text) = 0 Then
    MsgBox("harga jual belum diisi")
    Exit Sub
    End If

    If Val(t436109033.Text) = 0 Then
    MsgBox("jumlah barang")
    Exit Sub
    End If

    browse.AturPencarianDataBase("barang", "kodebarang", t136109033.Text, 1, CONECT)

    If browse.JumlanBaris > 0 Then
    MsgBox("kode sudah ada")
    Exit Sub
    End If

    Dim com As New OleDb.OleDbCommand
    com = New OleDb.OleDbCommand("insert into barang(kodebarang,namabarang,hargajual,jumlahbarang) Values('" & t136109033.Text & "','" & t236109033.Text & "'," & Val(t336109033.Text) & "," & Val(t436109033.Text) & ")", CONECT)

    CONECT.Open()
    com.ExecuteNonQuery()
    CONECT.Close()
    com.Dispose()

    t136109033.Text = ""
    t236109033.Text = ""
    t336109033.Text = ""
    t436109033.Text = ""

    LATIHAN033A36109033.pratiwi()
    End Sub

    End Class

    BalasHapus
  16. Public Class LATIHAN034A3610903
    Private Sub DAFTARBARANGToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DAFTARBARANGToolStripMenuItem.Click
    If LATIHAN034B36109033.Visible = False Then
    LATIHAN034B36109033.MdiParent = Me.MdiParent
    LATIHAN034B36109033.Show()

    Else
    LATIHAN034B36109033.Activate() 'jika sdh muncul tp dibelakang
    End If

    End Sub

    Private Sub INPUTBARANGToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles INPUTBARANGToolStripMenuItem.Click
    If LATIHAN034C36109033.Visible = False Then
    LATIHAN034C36109033.MdiParent = Me.MdiParent
    LATIHAN034C36109033.Show()

    Else
    LATIHAN034C36109033.Activate() 'jika sdh muncul tp dibelakang
    End If

    End Sub

    Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click
    If LATIHAN034B36109033.Visible = False Then
    LATIHAN034B36109033.MdiParent = Me.MdiParent
    LATIHAN034B36109033.Show()

    Else
    LATIHAN034B36109033.Activate() 'jika sdh muncul tp dibelakang
    End If
    End Sub

    Private Sub ToolStripButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton2.Click
    If LATIHAN034C36109033.Visible = False Then
    LATIHAN034C36109033.MdiParent = Me.MdiParent
    LATIHAN034C36109033.Show()

    Else
    LATIHAN034C36109033.Activate() 'jika sdh muncul tp dibelakang
    End If
    End Sub

    End Class

    BalasHapus
  17. Public Class LATIHAN034B36109033

    'dekklarasi connection
    Dim CONECT As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;Jet OLEDB:Database Password=nideria")
    'deklarasi tabel
    Dim tiwi As New DataTable

    Public Sub pratiwi()
    Dim adaptor As New OleDb.OleDbDataAdapter
    adaptor = New OleDb.OleDbDataAdapter("select * from barang", CONECT)
    tiwi.Rows.Clear()
    adaptor.Fill(tiwi)
    adaptor.Dispose()

    End Sub

    Private Sub LATIHAN034B36109033_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    pratiwi()
    DataGridView1.DataSource = tiwi
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
    If LATIHAN034C36109033.Visible = False Then
    LATIHAN034C36109033.Show()
    Else
    LATIHAN034C36109033.Activate() 'jika sdh muncul tp dibelakang
    End If
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    If LATIHAN034C36109033.Visible = False Then
    LATIHAN034C36109033.Show()
    Else
    LATIHAN034C36109033.Activate() 'jika sdh muncul tp dibelakang
    End If
    LATIHAN034C36109033.KB.Text = DataGridView1.CurrentRow.Cells("KODEBARANG").Value
    LATIHAN034C36109033.t136109033.Text = DataGridView1.CurrentRow.Cells("KODEBARANG").Value
    LATIHAN034C36109033.t236109033.Text = DataGridView1.CurrentRow.Cells("NAMABARANG").Value
    LATIHAN034C36109033.t336109033.Text = DataGridView1.CurrentRow.Cells("HARGAJUAL").Value
    LATIHAN034C36109033.t436109033.Text = DataGridView1.CurrentRow.Cells("JUMLAHBARANG").Value

    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
    Dim tahir As New OleDb.OleDbCommand
    tahir = New OleDb.OleDbCommand("DELETE * FROM BARANG WHERE KODEBARANG='" & DataGridView1.CurrentRow.Cells("KODEBARANG").Value & "'", conect)
    conect.Open()
    tahir.ExecuteNonQuery()
    conect.Close()
    tahir.Dispose()

    pratiwi()
    End Sub

    End Class

    BalasHapus
  18. Public Class LATIHAN034C36109033
    'dekklarasi connection
    Dim CONECT As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;Jet OLEDB:Database Password=tahir")
    Dim browse As New ByIskandar.CariKeDataBaseByIskandar

    Private Sub TAMBAH()
    'untuk mencari jgn sampai data yg akan dimasukkan tidak lengkap
    If t136109033.Text.Length = 0 Then
    MsgBox("kode barang belum terisi")
    Exit Sub 'jgn lanjut ke proses berikutnya
    End If

    If t236109033.Text.Length = 0 Then ' untuk pencarian yg bersifat huruf
    MsgBox("nama barang belum terisi")
    Exit Sub
    End If

    If Val(t336109033.Text) = 0 Then 'untuk pencarian yg bersifat angka
    MsgBox("harga jual belum diisi")
    Exit Sub
    End If

    If Val(t436109033.Text) = 0 Then
    MsgBox("JUMLAH BELUM TERISI")
    Exit Sub
    End If

    browse.AturPencarianDataBase("barang", "kode barang", t136109033.Text, 1, CONECT)

    If browse.JumlanBaris > 0 Then
    MsgBox("kode sudah ada")
    Exit Sub
    End If

    'untuk memasukkan data dari visual basc ke dlm acces
    Dim com As New OleDb.OleDbCommand
    com = New OleDb.OleDbCommand("update barang set kodebarang ='" & t136109033.Text & "',namabarang='" & t236109033.Text & "',hargajual=" & Val(t336109033.Text) & ", jumlahbarang=" & Val(t436109033.Text) & "where kodebarang='" & KB.Text & "'", CONECT)

    CONECT.Open() 'jembatannya dibuka
    com.ExecuteNonQuery() 'jalankan perintahnya
    CONECT.Close() 'tutup jembatan
    com.Dispose() 'hancurkan comand

    t136109033.Text = ""
    t236109033.Text = ""
    t336109033.Text = ""
    t436109033.Text = ""

    LATIHAN033A36109033.pratiwi()
    End Sub

    BalasHapus
  19. Private Sub EDIT()
    'untuk mencari jgn sampai data yg akan dimasukkan tidak lengkap
    If t136109033.Text.Length = 0 Then
    MsgBox("kode barang belum terisi")
    Exit Sub 'jgn lanjut ke proses berikutnya
    End If

    If t236109033.Text.Length = 0 Then ' untuk pencarian yg bersifat huruf
    MsgBox("nama barang belum terisi")
    Exit Sub
    End If

    If Val(t336109033.Text) = 0 Then 'untuk pencarian yg bersifat angka
    MsgBox("harga jual belum diisi")
    Exit Sub
    End If

    If Val(t436109033.Text) = 0 Then
    MsgBox("JUMLAH BELUM TERISI")
    Exit Sub
    End If

    If KB.Text <> t136109033.Text Then 'jika kode barang yg akan diganti dengan kode penggantinya tidak sama
    browse.AturPencarianDataBase("barang", "kode barang", t136109033.Text, 1, CONECT)

    If browse.JumlanBaris > 0 Then
    MsgBox("kode sudah ada")
    Exit Sub
    End If
    End If

    'untuk memasukkan data dari visual basc ke dlm acces
    Dim com As New OleDb.OleDbCommand
    com = New OleDb.OleDbCommand("update barang set kodebarang ='" & t136109033.Text & "',namabarang='" & t236109033.Text & "',hargajual=" & Val(t336109033.Text) & ", jumlahbarang=" & Val(t436109033.Text) & "where kodebarang='" & KB.Text & "'", CONECT)

    CONECT.Open() 'jembatannya dibuka
    com.ExecuteNonQuery() 'jalankan perintahnya
    CONECT.Close() 'tutup jembatan
    com.Dispose() 'hancurkan comand

    t136109033.Text = ""
    t236109033.Text = ""
    t336109033.Text = ""
    t436109033.Text = ""
    KB.Text = "-"


    LATIHAN033A36109033.pratiwi()

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    If KB.Text = "-" Then
    TAMBAH()
    Else
    EDIT()
    End If
    End Sub


    End Class

    BalasHapus
  20. Public Class Form33B36109050

    Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;Jet OLEDB:Database Password=nideria")
    Dim cari As New ByIskandar.CariKeDataBaseByIskandar


    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

    If t136109050.Text.Length = 0 Then
    MsgBox("kode barang belum terisi")
    Exit Sub
    End If

    If t236109050.Text.Length = 0 Then
    MsgBox("nama barang belum terisi")
    Exit Sub
    End If

    If Val(t336109050.Text) = 0 Then
    MsgBox("harga jual belum diisi")
    Exit Sub
    End If

    If Val(t436109050.Text) = 0 Then
    MsgBox("jumlah barang")
    Exit Sub
    End If

    cari.AturPencarianDataBase("barang", "kodebarang", t136109050.Text, 1, conect)

    If cari.JumlanBaris > 0 Then
    MsgBox("kode sudah ada")
    Exit Sub
    End If

    Dim com As New OleDb.OleDbCommand
    com = New OleDb.OleDbCommand("insert into barang(kodebarang,namabarang,hargajual,jumlahbarang) Values('" & t136109050.Text & "','" & t236109050.Text & "'," & Val(t336109050.Text) & "," & Val(t436109050.Text) & ")", conect)

    conect.Open()
    com.ExecuteNonQuery()
    conect.Close()
    com.Dispose()

    t136109050.Text = ""
    t236109050.Text = ""
    t336109050.Text = ""
    t436109050.Text = ""

    Form33A36109050.zaza()
    End Sub
    End Class

    BalasHapus
  21. Public Class Latih33B36109053
    Dim cari As New ByIskandar.CariKeDataBaseByIskandar
    Dim conect As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & Application.StartupPath & "\DATABARANG.accdb;jet OLEDB:database password=praditya")
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    If ToolStripStatusLabel1.Text = "KODE BARANG LAMA" Then
    cari.AturPencarianDataBase("Barang", "KodeBarang", t1.Text, 1, conect)
    yaya()
    Dim com As New OleDb.OleDbCommand
    com = New OleDb.OleDbCommand("insert into BARANG (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & t1.Text & "','" & t2.Text & "'," & Val(t3.Text) & "," & Val(t4.Text) & ")", conect)
    conect.Open()
    com.ExecuteNonQuery()
    conect.Close()
    com.Dispose()

    t1.Text = ""
    t2.Text = ""
    t3.Text = ""
    t4.Text = ""
    Else
    If ToolStripStatusLabel1.Text <> t1.Text Then
    cari.AturPencarianDataBase("Barang", "KodeBarang", t1.Text, 1, conect)
    yaya()
    End If
    Dim com As New OleDb.OleDbCommand
    com = New OleDb.OleDbCommand("UPDATE BARANG SET kodebarang = '" & t1.Text & "', namabarang = '" & t2.Text & "', hargajual = " & Val(t3.Text) & ", jumlahbarang = " & Val(t4.Text) & " where kodebarang ='" & ToolStripStatusLabel1.Text & "'", conect)

    conect.Open()
    com.ExecuteNonQuery()
    conect.Close()
    com.Dispose()

    t1.Text = ""
    t2.Text = ""
    t3.Text = ""
    t4.Text = ""
    End If
    End Sub
    Public Sub yaya()
    If cari.JumlanBaris > 0 Then
    MsgBox("kode barang telah ada")
    t1.Text = ""
    Exit Sub
    ElseIf t1.Text.Length = 0 Then
    MsgBox("kode barang harus tercantum")
    Exit Sub
    ElseIf t2.Text.Length = 0 Then
    MsgBox("nama barang harus tercantum")
    Exit Sub
    ElseIf t3.Text.Length = 0 Then
    MsgBox("harga jual harus tercantum")
    Exit Sub
    ElseIf t3.Text.Length = 0 Then
    MsgBox("jumlah barang harus tercantum")
    Exit Sub
    End If
    End Sub
    End Class

    BalasHapus
  22. Public Class Latih33B36109040
    Dim cari As New ByIskandar.CariKeDataBaseByIskandar
    Dim conect As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & Application.StartupPath & "\DATABARANG.accdb;jet OLEDB:database password=150991")
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    If ToolStripStatusLabel1.Text = "KODE BARANG LAMA" Then
    cari.AturPencarianDataBase("Barang", "KodeBarang", t1.Text, 1, conect)
    yaya()
    Dim com As New OleDb.OleDbCommand
    com = New OleDb.OleDbCommand("insert into BARANG (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & t1.Text & "','" & t2.Text & "'," & Val(t3.Text) & "," & Val(t4.Text) & ")", conect)
    conect.Open()
    com.ExecuteNonQuery()
    conect.Close()
    com.Dispose()

    t1.Text = ""
    t2.Text = ""
    t3.Text = ""
    t4.Text = ""
    Else
    If ToolStripStatusLabel1.Text <> t1.Text Then
    cari.AturPencarianDataBase("Barang", "KodeBarang", t1.Text, 1, conect)
    yaya()
    End If
    Dim com As New OleDb.OleDbCommand
    com = New OleDb.OleDbCommand("UPDATE BARANG SET kodebarang = '" & t1.Text & "', namabarang = '" & t2.Text & "', hargajual = " & Val(t3.Text) & ", jumlahbarang = " & Val(t4.Text) & " where kodebarang ='" & ToolStripStatusLabel1.Text & "'", conect)

    conect.Open()
    com.ExecuteNonQuery()
    conect.Close()
    com.Dispose()

    t1.Text = ""
    t2.Text = ""
    t3.Text = ""
    t4.Text = ""
    End If
    End Sub
    Public Sub yaya()
    If cari.JumlanBaris > 0 Then
    MsgBox("kode barang telah ada")
    t1.Text = ""
    Exit Sub
    ElseIf t1.Text.Length = 0 Then
    MsgBox("kode barang harus tercantum")
    Exit Sub
    ElseIf t2.Text.Length = 0 Then
    MsgBox("nama barang harus tercantum")
    Exit Sub
    ElseIf t3.Text.Length = 0 Then
    MsgBox("harga jual harus tercantum")
    Exit Sub
    ElseIf t3.Text.Length = 0 Then
    MsgBox("jumlah barang harus tercantum")
    Exit Sub
    End If
    End Sub
    End Class

    BalasHapus
  23. Public Class Lat33B36109042
    Dim cari As New ByIskandar.CariKeDataBaseByIskandar
    Dim conect As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & Application.StartupPath & "\DATABARANG.accdb;jet OLEDB:database password=280765")
    Private Sub Button136109042_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button136109042.Click
    If ToolStripStatusLabel1.Text = "KODE BARANG LAMA" Then
    cari.AturPencarianDataBase("Barang", "KodeBarang", t136109042.Text, 1, conect)
    jal()
    Dim com As New OleDb.OleDbCommand
    com = New OleDb.OleDbCommand("insert into BARANG (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & t136109042.Text & "','" & t236109042.Text & "'," & Val(t336109042.Text) & "," & Val(t436109042.Text) & ")", conect)
    conect.Open()
    com.ExecuteNonQuery()
    conect.Close()
    com.Dispose()

    t136109042.Text = ""
    t236109042.Text = ""
    t336109042.Text = ""
    t436109042.Text = ""
    Else
    If ToolStripStatusLabel1.Text <> t136109042.Text Then
    cari.AturPencarianDataBase("Barang", "KodeBarang", t136109042.Text, 1, conect)
    jal()

    End If
    Dim com As New OleDb.OleDbCommand
    com = New OleDb.OleDbCommand("UPDATE BARANG SET kodebarang = '" & t136109042.Text & "', namabarang = '" & t236109042.Text & "', hargajual = " & Val(t336109042.Text) & ", jumlahbarang = " & Val(t436109042.Text) & " where kodebarang ='" & ToolStripStatusLabel1.Text & "'", conect)

    conect.Open()
    com.ExecuteNonQuery()
    conect.Close()
    com.Dispose()

    t136109042.Text = ""
    t236109042.Text = ""
    t336109042.Text = ""
    t436109042.Text = ""
    End If
    End Sub
    Public Sub jal()
    If cari.JumlanBaris > 0 Then
    MsgBox("kode barang telah ada")
    t136109042.Text = ""
    Exit Sub
    ElseIf t136109042.Text.Length = 0 Then
    MsgBox("kode barang harus tercantum")
    Exit Sub
    ElseIf t236109042.Text.Length = 0 Then
    MsgBox("nama barang harus tercantum")
    Exit Sub
    ElseIf t336109042.Text.Length = 0 Then
    MsgBox("harga jual harus tercantum")
    Exit Sub
    ElseIf t336109042.Text.Length = 0 Then
    MsgBox("jumlah barang harus tercantum")
    Exit Sub
    End If
    End Sub
    End Class

    BalasHapus
  24. Public Class Lat33B36109042
    Dim cari As New ByIskandar.CariKeDataBaseByIskandar
    Dim conect As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & Application.StartupPath & "\DATABARANG.accdb;jet OLEDB:database password=25")
    Private Sub Button136109042_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button136109042.Click
    If ToolStripStatusLabel1.Text = "KODE BARANG LAMA" Then
    cari.AturPencarianDataBase("Barang", "KodeBarang", t136109042.Text, 1, conect)
    jal()
    Dim com As New OleDb.OleDbCommand
    com = New OleDb.OleDbCommand("insert into BARANG (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & t136109042.Text & "','" & t236109042.Text & "'," & Val(t336109042.Text) & "," & Val(t436109042.Text) & ")", conect)
    conect.Open()
    com.ExecuteNonQuery()
    conect.Close()
    com.Dispose()

    t136109042.Text = ""
    t236109042.Text = ""
    t336109042.Text = ""
    t436109042.Text = ""
    Else
    If ToolStripStatusLabel1.Text <> t136109042.Text Then
    cari.AturPencarianDataBase("Barang", "KodeBarang", t136109042.Text, 1, conect)
    jal()

    End If
    Dim com As New OleDb.OleDbCommand
    com = New OleDb.OleDbCommand("UPDATE BARANG SET kodebarang = '" & t136109042.Text & "', namabarang = '" & t236109042.Text & "', hargajual = " & Val(t336109042.Text) & ", jumlahbarang = " & Val(t436109042.Text) & " where kodebarang ='" & ToolStripStatusLabel1.Text & "'", conect)

    conect.Open()
    com.ExecuteNonQuery()
    conect.Close()
    com.Dispose()

    t136109042.Text = ""
    t236109042.Text = ""
    t336109042.Text = ""
    t436109042.Text = ""
    End If
    End Sub
    Public Sub jal()
    If cari.JumlanBaris > 0 Then
    MsgBox("kode barang telah ada")
    t136109042.Text = ""
    Exit Sub
    ElseIf t136109042.Text.Length = 0 Then
    MsgBox("kode barang harus tercantum")
    Exit Sub
    ElseIf t236109042.Text.Length = 0 Then
    MsgBox("nama barang harus tercantum")
    Exit Sub
    ElseIf t336109042.Text.Length = 0 Then
    MsgBox("harga jual harus tercantum")
    Exit Sub
    ElseIf t336109042.Text.Length = 0 Then
    MsgBox("jumlah barang harus tercantum")
    Exit Sub
    End If
    End Sub
    End Class

    BalasHapus
  25. Public Class LATIHAN033B36109030
    Dim cari As New ByIskandar.CariKeDataBaseByIskandar
    Dim conect As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & Application.StartupPath & "\DATABARANG.accdb;jet OLEDB:database password=sanie")
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    If ToolStripStatusLabel1.Text = "KODE BARANG LAMA" Then
    cari.AturPencarianDataBase("Barang", "KodeBarang", t1.Text, 1, conect)
    sanie()
    Dim com As New OleDb.OleDbCommand
    com = New OleDb.OleDbCommand("insert into BARANG (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & t1.Text & "','" & t2.Text & "'," & Val(t3.Text) & "," & Val(t4.Text) & ")", conect)
    conect.Open()
    com.ExecuteNonQuery()
    conect.Close()
    com.Dispose()

    t1.Text = ""
    t2.Text = ""
    t3.Text = ""
    t4.Text = ""
    Else
    If ToolStripStatusLabel1.Text <> t1.Text Then
    cari.AturPencarianDataBase("Barang", "KodeBarang", t1.Text, 1, conect)
    sanie()

    End If
    Dim com As New OleDb.OleDbCommand
    com = New OleDb.OleDbCommand("UPDATE BARANG SET kodebarang = '" & t1.Text & "', namabarang = '" & t2.Text & "', hargajual = " & Val(t3.Text) & ", jumlahbarang = " & Val(t4.Text) & " where kodebarang ='" & ToolStripStatusLabel1.Text & "'", conect)

    conect.Open()
    com.ExecuteNonQuery()
    conect.Close()
    com.Dispose()

    t1.Text = ""
    t2.Text = ""
    t3.Text = ""
    t4.Text = ""
    End If
    End Sub
    Public Sub sanie()
    If cari.JumlanBaris > 0 Then
    MsgBox("kode barang telah ada")
    t1.Text = ""
    Exit Sub
    ElseIf t1.Text.Length = 0 Then
    MsgBox("kode barang harus tercantum")
    Exit Sub
    ElseIf t2.Text.Length = 0 Then
    MsgBox("nama barang harus tercantum")
    Exit Sub
    ElseIf t3.Text.Length = 0 Then
    MsgBox("harga jual harus tercantum")
    Exit Sub
    ElseIf t3.Text.Length = 0 Then
    MsgBox("jumlah barang harus tercantum")
    Exit Sub
    End If
    End Sub
    End Class

    BalasHapus
  26. http://hilariusmariotonapa.blogspot.com/2012/10/prosedur-penyelesaian-latihan33a36110048.html

    http://hilariusmariotonapa.blogspot.com/2012/10/deskripsi-latihan33a36110048.html


    http://hilariusmariotonapa.blogspot.com/2012/10/prosedur-penyelesaian-latihan32b36110048_8858.html

    http://hilariusmariotonapa.blogspot.com/2012/10/deskripsi-latihan33b36110048.html

    BalasHapus
  27. http://nurrahmahrasyid2.blogspot.com/2012/10/latihan33a36110042.html

    http://nurrahmahrasyid2.blogspot.com/2012/10/latihan33b36110042.html

    BalasHapus
  28. http://ilhaazzahra.blogspot.com/2012/10/latihan33a36110033.html
    http://ilhaazzahra.blogspot.com/2012/10/latihan33b36110033.html

    BalasHapus
  29. http://rizka-azisah.blogspot.com/2012/10/deskripsi-penyelesaian_696.html
    http://rizka-azisah.blogspot.com/2012/10/deskripsi-penyelesaian_402.html

    BalasHapus
  30. http://andiniwarakusuma.blogspot.com/2012/10/latihan33a36110034.html
    http://andiniwarakusuma.blogspot.com/2012/10/latihan33b36110034.html

    BalasHapus
  31. http://rahmisuryatama05.blogspot.com/2012/10/latihan33a36110040.html
    http://rahmisuryatama05.blogspot.com/2012/10/latihan33b36110040.html

    BalasHapus
  32. http://benhilll.blogspot.com/2012/10/deskripsi-dan-prosedur_2155.html

    http://benhilll.blogspot.com/2012/10/deskripsi-dan-prosedur_1637.html

    BalasHapus
  33. http://audryasharii.blogspot.com/2012/10/latihan33a36110031.html

    http://audryasharii.blogspot.com/2012/10/latihan33b36110031.html

    BalasHapus
  34. http://rosyanausman.blogspot.com/2012/10/latihan33a36110036.html
    http://rosyanausman.blogspot.com/2012/10/latihan33b36110036.html

    BalasHapus
  35. http://rainaagrippinaa.blogspot.com/#!/2012/10/latihan33a36110032.html
    http://rainaagrippinaa.blogspot.com/#!/2012/10/latihan33b36110032.html

    BalasHapus
  36. http://tiya-sri.blogspot.com/2012/10/latihan33a36110044-aplikasi-komputer-4.html

    http://tiya-sri.blogspot.com/2012/10/latihan33b36110044-aplikasi-komputer-4.html

    BalasHapus
  37. http://reskypurwono.blogspot.com/2012/10/prosedur-penyelesaian-latihan33a36110037.html

    http://reskypurwono.blogspot.com/2012/10/prosedur-penyelesaian-latihan33b36110037.html

    BalasHapus
  38. http://03melisa.blogspot.com/2012/10/latihan-33a-36110051-apkom-4-akuntansi.html

    http://03melisa.blogspot.com/2012/10/latihan-33b-36110051-apkom-4-akuntansi.html

    BalasHapus
  39. http://sriayu-36110030.blogspot.com/2012/10/diskripsi-prosedur-latihan-33-a.html

    http://sriayu-36110030.blogspot.com/2012/10/diskripsi-prosedur-latihan-33-b.html

    BalasHapus
  40. http://burhankhang58.blogspot.com/2012/10/latihan33a36110047.html

    http://burhankhang58.blogspot.com/2012/10/latihan33b36110047.html

    BalasHapus
  41. http://masnurselayar.blogspot.com/2012/10/latihan-33a36110055.html

    http://masnurselayar.blogspot.com/2012/10/latihan-33b36110055.html

    BalasHapus
  42. http://dewiwahyuni91.blogspot.com/2012/10/latihan33a36110038_6732.html

    http://dewiwahyuni91.blogspot.com/2012/10/latihan33b36110038_3785.html

    BalasHapus
  43. http://hasfiahzain.blogspot.com/2012/10/latihan33a36110052.html

    http://hasfiahzain.blogspot.com/2012/10/latihan33b36110052.html

    BalasHapus
  44. http://ias-anakbola.blogspot.com/2012/10/latihan33a36110056.html
    http://ias-anakbola.blogspot.com/2012/10/latihan33b36110056.html

    BalasHapus
  45. http://eminaomi.blogspot.com/2012/10/latihan33a36110049.html

    http://eminaomi.blogspot.com/2012/10/latihan33b36110049.html

    BalasHapus
  46. http://nurhanalott.blogspot.com/2012/10/latihan33a36110029.html
    http://nurhanalott.blogspot.com/2012/10/latihan33b36110029.html

    BalasHapus
  47. http://zulkiflitryputra.blogspot.com/2012/10/latihan33a36110046.html

    http://zulkiflitryputra.blogspot.com/2012/10/latihan33b36110046.html

    BalasHapus
  48. http://sukadriady.blogspot.com/2012/10/latihan33a36110043.html
    http://sukadriady.blogspot.com/2012/10/latihan33b36110043.html

    BalasHapus
  49. http://ruslancullank1.blogspot.com/2012/10/deskripsilatihan33a36110054.html
    http://ruslancullank1.blogspot.com/2012/10/deskripsilatihan33b36110054.html

    BalasHapus