Sabtu, 29 Oktober 2011

Matakuliah Apkom 4 Latihan 23-26 D4B

Silahkan kumpul disini

26 komentar:

  1. Komentar ini telah dihapus oleh administrator blog.

    BalasHapus
  2. Komentar ini telah dihapus oleh pengarang.

    BalasHapus
  3. FARADILLAH AMALIA RIVAI

    TUGAS 24A

    Public Class latihan24a_46109010
    Dim koneksi As New OleDb.OleDbConnection("provider=microsoft.ACE.oledb.12.0;data source=" & Application.StartupPath & "\datatransaksijualbeli.accdb")
    Dim faradillah As New DataTable

    Private Sub latihan_23a_008_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Dim adapter As New OleDb.OleDbDataAdapter
    adapter = New OleDb.OleDbDataAdapter("select*from mastertransaksi", koneksi)
    faradillah.Rows.Clear()
    adapter.Fill(faradillah)
    adapter.Dispose()

    data46109010.DataSource = faradillah

    End Sub

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

    latihan23b_46109010.n46109010.Text = data46109010.CurrentRow.Cells("notrans").Value
    latihan23b_46109010.t46109010.Value = data46109010.CurrentRow.Cells("tanggaltransaksi").Value
    latihan23b_46109010.j46109010.Text = data46109010.CurrentRow.Cells("jenistransaksi").Value

    latihan23b_46109010.uly(latihan23b_46109010.n46109010.Text)

    End Sub

    End Class


    TUGAS 24B


    Public Class latihan24b_46109010
    Dim koneksi As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\datatransaksijualbeli.accdb")
    Dim faradillah As New DataTable

    Public Sub uly(ByVal a As String)
    Dim adapter As New OleDb.OleDbDataAdapter
    adapter = New OleDb.OleDbDataAdapter("select*from barang inner join detailtransaksi on barang.kodebarang = detailtransaksi.kodebarang='" & a & "'", koneksi)
    faradillah.Rows.Clear()
    adapter.Fill(faradillah)
    adapter.Dispose()

    data46109010.DataSource = faradillah

    End Sub
    End Class

    BalasHapus
  4. FARADILLAH AMALIA RIVAI

    TUGAS 25A

    Public Class latihan25a_46109010
    Dim conect As New OleDb.OleDbConnection("provider=microsoft.ACE.oledb.12.0;data source=" & Application.StartupPath & "\datatransaksijualbeli.accdb")
    Dim faradillah As New DataTable
    Private Sub latihan25a_46109010Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Dim farah As New OleDb.OleDbDataAdapter
    farah = New OleDb.OleDbDataAdapter("select*from barang", conect)
    faradillah.Rows.Clear()
    farah.Fill(faradillah)
    farah.Dispose()

    data46109010.DataSource = faradillah

    End Sub

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

    latihan25b_46109010.kb46109010.Text = data46109010.CurrentRow.Cells("kodebarang").Value
    latihan25b_46109010.nb46109010.Text = data46109010.CurrentRow.Cells("namabarang").Value
    latihan25b_46109010.hj46109010.Text = data46109010.CurrentRow.Cells("hargajual").Value
    latihan25b_46109010.jb46109010.Text = data46109010.CurrentRow.Cells("persediaanawal").Value

    latihan25b_46109010.uly(latihan25b_46109010.kb46109010.Text)

    End Sub
    End Class


    TUGAS 25B

    Public Class latihan25b_46109010
    Dim koneksi As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\datatransaksijualbeli.accdb")
    Dim faradillah As New DataTable

    Public Sub uly(ByVal A As String)
    Dim adapter As New OleDb.OleDbDataAdapter
    adapter = New OleDb.OleDbDataAdapter("select*from detailtransaksi where kodebarang='" & A & "'", koneksi)
    faradillah.Rows.Clear()
    adapter.Fill(faradillah)

    data46109010.DataSource = faradillah

    End Sub

    End Class

    BalasHapus
  5. Komentar ini telah dihapus oleh pengarang.

    BalasHapus
  6. Komentar ini telah dihapus oleh pengarang.

    BalasHapus
  7. Faradillah Amalia Rivai

    Tugas 23A

    Public Class latihan23a_46109010


    Dim conect As New OleDb.OleDbConnection("provider=microsoft.ACE.oledb.12.0;data source=" & Application.StartupPath & "\datatransaksijualbeli.accdb")
    Dim faradillah As New DataTable
    Private Sub button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    If latihan23b_46109010.Visible = False Then
    latihan23b_46109010.Show()
    Else
    latihan23b_46109010.Activate()
    End If

    latihan23b_46109010.n46109010.Text = data46109010.CurrentRow.Cells("notrans").Value
    latihan23b_46109010.t46109010.Value = data46109010.CurrentRow.Cells("tanggaltransaksi").Value
    latihan23b_46109010.j46109010.Text = data46109010.CurrentRow.Cells("jenistransaksi").Value

    latihan23b_46109010.uly(latihan23b_46109010.n46109010.Text)
    End Sub
    Private Sub latihan23a_46109010Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Dim farah As New OleDb.OleDbDataAdapter
    farah = New OleDb.OleDbDataAdapter("select*from mastertransaksi", conect)
    faradillah.Rows.Clear()
    farah.Fill(faradillah)
    farah.Dispose()

    data46109010.DataSource = faradillah

    End Sub
    End Class

    TUGAS 23B

    Public Class latihan23b_46109010
    Dim koneksi As New OleDb.OleDbConnection("provider=microsoft.ACE.oledb.12.0;data source=" & Application.StartupPath & "\datatransaksijualbeli.accdb")
    Dim faradillah As New DataTable

    Public Sub uly(ByVal A As String)
    Dim adapter As New OleDb.OleDbDataAdapter
    adapter = New OleDb.OleDbDataAdapter("select*from detailtransaksi where notrans='" & A & "'", koneksi)
    faradillah.Rows.Clear()
    adapter.Fill(faradillah)

    data46109010.DataSource = faradillah

    End Sub

    End Class

    BalasHapus
  8. FARADILLAH AMALIA RIVAI

    TUGAS 26A

    Public Class latihan26a_46109010

    Dim conect As New OleDb.OleDbConnection("provider=microsoft.ACE.oledb.12.0;data source=" & Application.StartupPath & "\datatransaksijualbeli.accdb")
    Dim faradillah As New DataTable
    Private Sub latihan_26a_008_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Dim adapter As New OleDb.OleDbDataAdapter
    adapter = New OleDb.OleDbDataAdapter("select*from barang", conect)
    faradillah.Rows.Clear()
    adapter.Fill(faradillah)
    adapter.Dispose()

    data46109010.DataSource = faradillah

    End Sub

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

    End Class


    TUGAS 26B

    Public Class latihan26b_46109010

    Dim koneksi As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\datatransaksijualbeli.accdb")
    Dim faradillah As New DataTable

    Public Sub uly(ByVal A As String)
    Dim adapter As New OleDb.OleDbDataAdapter
    Dim Rossi As String
    Rossi = "SELECT MASTERTRANSAKSI.NOTRANS, MASTERTRANSAKSI.TANGGALTRANSAKSI, MASTERTRANSAKSI.JENISTRANSAKSI, MASTERTRANSAKSI.KETERANGAN, DETAILTRANSAKSI.UNIT, DETAILTRANSAKSI.HARGA, [DETAILTRANSAKSI]![UNIT]*[DETAILTRANSAKSI]![HARGA] AS JUMLAH FROM DETAILTRANSAKSI INNER JOIN MASTERTRANSAKSI ON DETAILTRANSAKSI.NOTRANS = MASTERTRANSAKSI.NOTRANS WHERE KODEBARANG = '" & A & "'"
    adapter = New OleDb.OleDbDataAdapter(Rossi, koneksi)
    adapter.Fill(faradillah)

    Dim farah As Integer = 0
    Dim rivai As Integer = 0
    For Each row As DataRow In faradillah.Rows
    farah += row("Unit")
    rivai += row("Jumlah")
    Next
    TU46109010.Text = farah
    tj46109010.Text = rivai

    End Sub

    Private Sub latihan26b_46109010Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    data46109010.DataSource = faradillah


    End Sub
    End Class

    BalasHapus
  9. Komentar ini telah dihapus oleh pengarang.

    BalasHapus
  10. Public Class Latihan23A46109047
    Dim conect As New OleDb.OleDbConnection("provider=microsoft.ACE.oledb.12.0;data source=" & Application.StartupPath & "\datatransaksijualbeli.accdb")
    Dim itha As New DataTable
    Private Sub KLIK46109047_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles KLIK46109047.Click
    If Latihan23B46109047.Visible = False Then
    Latihan23B46109047.Show()
    Else : Latihan23B46109047.Activate()
    End If
    Latihan23B46109047.TB146109047.Text = DG46109047.CurrentRow.Cells("notrans").Value
    Latihan23B46109047.DTP46109047.Value = DG46109047.CurrentRow.Cells("tanggaltransaksi").Value
    Latihan23B46109047.TB246109047.Text = DG46109047.CurrentRow.Cells("jenistransaksi").Value
    Latihan23B46109047.uly(Latihan23B46109047.TB146109047.Text)
    End Sub
    Private Sub Latihan23A46109047_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Dim muhitha As New OleDb.OleDbDataAdapter
    muhitha = New OleDb.OleDbDataAdapter("select*from mastertransaksi", conect)
    itha.Rows.Clear()
    muhitha.Fill(itha)
    muhitha.Dispose()
    DG46109047.DataSource = itha
    End Sub
    End Class
    Public Class Latihan23B46109047
    Dim koneksi As New OleDb.OleDbConnection("provider=microsoft.ACE.oledb.12.0;data source=" & Application.StartupPath & "\datatransaksijualbeli.accdb")
    Dim muhitha As New DataTable
    Public Sub uly(ByVal A As String)
    Dim adapter As New OleDb.OleDbDataAdapter
    adapter = New OleDb.OleDbDataAdapter("select*from detailtransaksi where notrans='" & A & "'", koneksi)
    muhitha.Rows.Clear()
    adapter.Fill(muhitha)
    DG46109047.DataSource = muhitha
    End Sub
    Private Sub Latihan23B46109047_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    End Sub
    End Class

    BalasHapus
  11. Public Class Latihan24A46109047
    Dim conect As New OleDb.OleDbConnection("provider=microsoft.ACE.oledb.12.0;data source=" & Application.StartupPath & "\datatransaksijualbeli.accdb")
    Dim muhitha As New DataTable
    Private Sub BT46109047_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BT46109047.Click
    If Latihan24B46109047.Visible = False Then
    Latihan24B46109047.Show()
    Else : Latihan24B46109047.Activate()
    End If
    Latihan24B46109047.TB146109047.Text = DG46109047.CurrentRow.Cells("kodebarang").Value
    Latihan24B46109047.TB246109047.Text = DG46109047.CurrentRow.Cells("namabarang").Value
    Latihan24B46109047.TB346109047.Text = DG46109047.CurrentRow.Cells("hargajual").Value
    Latihan24B46109047.TB446109047.Text = DG46109047.CurrentRow.Cells("persediaanawal").Value
    Latihan24B46109047.uly(Latihan24B46109047.TB146109047.Text)
    End Sub
    Private Sub Latihan24A46109047_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Dim itha As New OleDb.OleDbDataAdapter
    itha = New OleDb.OleDbDataAdapter("select*from barang", conect)
    muhitha.Rows.Clear()
    itha.Fill(muhitha)
    itha.Dispose()
    DG46109047.DataSource = muhitha
    End Sub
    End Class

    Public Class Latihan24B46109047
    Dim koneksi As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\datatransaksijualbeli.accdb")
    Dim muhitha As New DataTable
    Public Sub uly(ByVal A As String)
    Dim adapter As New OleDb.OleDbDataAdapter
    adapter = New OleDb.OleDbDataAdapter("select*from detailtransaksi where kodebarang='" & A & "'", koneksi)
    muhitha.Rows.Clear()
    adapter.Fill(muhitha)
    DG46109047.DataSource = muhitha
    End Sub
    Private Sub Latihan24B46109047_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    End Sub
    End Class

    BalasHapus
  12. Public Class Latihan25A46109047
    Dim conect As New OleDb.OleDbConnection("provider=microsoft.ACE.oledb.12.0;data source=" & Application.StartupPath & "\datatransaksijualbeli.accdb")
    Dim muhitha As New DataTable
    Private Sub BT46109047_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BT46109047.Click
    If Latihan25B46109047.Visible = False Then
    Latihan25B46109047.Show()
    Else : Latihan25B46109047.Activate()
    End If

    Latihan25B46109047.TB146109047.Text = DG46109047.CurrentRow.Cells("kodebarang").Value
    Latihan25B46109047.TB246109047.Text = DG46109047.CurrentRow.Cells("namabarang").Value
    Latihan25B46109047.TB346109047.Text = DG46109047.CurrentRow.Cells("hargajual").Value
    Latihan25B46109047.TB446109047.Text = DG46109047.CurrentRow.Cells("persediaanawal").Value
    Latihan25B46109047.uly(Latihan25B46109047.TB146109047.Text)
    End Sub
    Private Sub Latihan25A46109047_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Dim itha As New OleDb.OleDbDataAdapter
    itha = New OleDb.OleDbDataAdapter("select*from barang", conect)
    muhitha.Rows.Clear()
    itha.Fill(muhitha)
    itha.Dispose()
    DG46109047.DataSource = muhitha
    End Sub
    End Class
    Public Class Latihan25B46109047
    Dim koneksi As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\datatransaksijualbeli.accdb")
    Dim muhitha As New DataTable
    Public Sub uly(ByVal A As String)
    Dim adapter As New OleDb.OleDbDataAdapter
    adapter = New OleDb.OleDbDataAdapter("select*from detailtransaksi where kodebarang='" & A & "'", koneksi)
    muhitha.Rows.Clear()
    adapter.Fill(muhitha)

    DG46109047.DataSource = muhitha
    End Sub
    Private Sub Latihan25B46109047_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    End Sub
    End Class

    BalasHapus
  13. Public Class Latihan26A46109047
    Dim conect As New OleDb.OleDbConnection("provider=microsoft.ACE.oledb.12.0;data source=" & Application.StartupPath & "\datatransaksijualbeli.accdb")
    Dim muhitha As New DataTable
    Private Sub BT46109047_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BT46109047.Click
    If Latihan26B46109047.Visible = False Then
    Latihan26B46109047.Show()
    Else : Latihan26B46109047.Activate()
    End If
    Latihan26B46109047.TB146109047.Text = DG46109047.CurrentRow.Cells("kodebarang").Value
    Latihan26B46109047.TB246109047.Text = DG46109047.CurrentRow.Cells("namabarang").Value
    Latihan26B46109047.TB346109047.Text = DG46109047.CurrentRow.Cells("hargajual").Value
    Latihan26B46109047.TB446109047.Text = DG46109047.CurrentRow.Cells("persediaanawal").Value
    Latihan26B46109047.uly(Latihan26B46109047.TB146109047.Text)
    End Sub
    Private Sub Latihan26A6109047_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Dim itha As New OleDb.OleDbDataAdapter
    itha = New OleDb.OleDbDataAdapter("select*from barang", conect)
    muhitha.Rows.Clear()
    itha.Fill(muhitha)
    itha.Dispose()
    DG46109047.DataSource = muhitha
    End Sub
    End Class

    Public Class Latihan26B46109047
    Dim koneksi As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\datatransaksijualbeli.accdb")
    Dim Nurmuhitha As New DataTable
    Public Sub uly(ByVal A As String)
    Dim muhitha As New OleDb.OleDbDataAdapter
    Dim itha As String
    itha = "SELECT MASTERTRANSAKSI.NOTRANS, MASTERTRANSAKSI.TANGGALTRANSAKSI, MASTERTRANSAKSI.JENISTRANSAKSI, MASTERTRANSAKSI.KETERANGAN, DETAILTRANSAKSI.UNIT, DETAILTRANSAKSI.HARGA, [DETAILTRANSAKSI]![UNIT]*[DETAILTRANSAKSI]![HARGA] AS JUMLAH FROM DETAILTRANSAKSI INNER JOIN MASTERTRANSAKSI ON DETAILTRANSAKSI.NOTRANS = MASTERTRANSAKSI.NOTRANS WHERE KODEBARANG = '" & A & "'"
    muhitha = New OleDb.OleDbDataAdapter(itha, koneksi)
    muhitha.Fill(Nurmuhitha)
    Dim itha1 As Integer = 0
    Dim itha2 As Integer = 0
    For Each itha3 As DataRow In Nurmuhitha.Rows
    itha1 += itha3("Unit")
    itha2 += itha3("Jumlah")

    Next
    TU46109047.Text = itha1
    TJ46109047.Text = itha2
    End Sub
    Private Sub Latihan26B46109047_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    DG46109047.DataSource = Nurmuhitha
    End Sub
    End Class

    BalasHapus
  14. Public Class latihan23a46109058

    Dim Kendaraan As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source =d:\berbagi\sharing2\LATIHAN 15-26 MENGAKSES DATA\DataTransaksiJualBeli.accdb")
    Dim Penampung As New DataTable
    Private Sub latihan23a46109058_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Dim Mobil As New OleDb.OleDbDataAdapter
    Mobil = New OleDb.OleDbDataAdapter("SELECT * FROM MASTERTRANSAKSI", Kendaraan)
    Penampung.Rows.Clear()
    Mobil.Fill(Penampung)
    Mobil.Dispose()

    DGV46109058.DataSource = Penampung
    End Sub

    Private Sub K46109058_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles K46109058.Click
    latihan23b46109058.Show()
    latihan23b46109058.TextBox146109058.Text = DGV46109058.CurrentRow.Cells("NOTRANS").Value
    latihan23b46109058.DateTimePicker46109058.Text = DGV46109058.CurrentRow.Cells("TANGGALTRANSAKSI").Value
    latihan23b46109058.TextBox346109058.Text = DGV46109058.CurrentRow.Cells("JENISTRANSAKSI").Value

    latihan23b46109058.AmbilDataDetail()
    End Sub
    End Class

    Public Class latihan23b46109058

    Dim Kendaraan As New OleDb.OleDbConnection(" Provider=microsoft.ace.oledb.12.0;data source= “ & Application.StartupPath & “\datatransaksijualbeli.accdb")
    Dim Penampung As New DataTable
    Public Sub AmbilDataDetail()
    Dim x As New OleDb.OleDbDataAdapter
    x = New OleDb.OleDbDataAdapter("select DETAILTRANSAKSI.NOTRANS, DETAILTRANSAKSI.UNIT, DETAILTRANSAKSI.HARGA from DETAILTRANSAKSI where NOTRANS ='" & TextBox146109058.Text & "'", Kendaraan)
    Penampung.Rows.Clear()
    x.Fill(Penampung)
    x.Dispose()

    End Sub
    Private Sub latihan23b46109058_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    AmbilDataDetail()
    DGV146109058.DataSource = Penampung

    End Sub

    End Class
    Public Class latihan24a46109058


    Dim konek As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source =d:\berbagi\sharing2\LATIHAN 15-26 MENGAKSES DATA\DataTransaksiJualBeli.accdb")
    Dim syahril As New DataTable
    Dim baris As DataRow

    Private Sub latihan24a46109058_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Dim cobaji As New OleDb.OleDbDataAdapter
    cobaji = New OleDb.OleDbDataAdapter("select * from BARANG", konek)
    cobaji.Fill(syahril)
    DataGridView46109058.DataSource = syahril
    End Sub

    Private Sub DT46109058_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DT46109058.Click
    If latihan24b46109058.Visible = False Then
    latihan24b46109058.Show()
    Else
    latihan24b46109058.Activate()
    End If
    baris = syahril.DefaultView(BindingContext(syahril).Position).Row
    latihan24b46109058.TBx146109058.Text = baris("KODEBARANG")
    latihan24b46109058.TBx246109058.Text = baris("NAMABARANG")
    latihan24b46109058.TBx346109058.Text = baris("HARGAJUAL")
    latihan24b46109058.TBx446109058.Text = baris("PERSEDIAANAWAL")
    latihan24b46109058.AmbilData()
    End Sub
    End Class

    BalasHapus
  15. Public Class latihan24b46109058

    Dim konek As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source =d:\berbagi\sharing2\LATIHAN 15-26 MENGAKSES DATA\DataTransaksiJualBeli.accdb")
    Dim ahmad As New DataTable
    Dim irvan As New OleDb.OleDbDataAdapter
    Public Sub AmbilData()
    irvan = New OleDb.OleDbDataAdapter("select DETAILTRANSAKSI.KODEBARANG, DETAILTRANSAKSI.UNIT, DETAILTRANSAKSI.HARGA from DETAILTRANSAKSI where KODEBARANG ='" & TBx146109058.Text & "'", konek)
    irvan.Fill(ahmad)
    End Sub

    Private Sub latihan24b46109058_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    AmbilData()
    DGV46109058.DataSource = ahmad
    End Sub

    End Class

    Public Class latihan25a46109058

    Dim konek As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source =d:\berbagi\sharing2\LATIHAN 15-26 MENGAKSES DATA\DataTransaksiJualBeli.accdb")
    Dim irvan As New DataTable
    Dim baris As DataRow
    Dim cobaji As New OleDb.OleDbDataAdapter
    Private Sub latihan25a46109058_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    cobaji = New OleDb.OleDbDataAdapter("select * from BARANG", konek)
    cobaji.Fill(irvan)
    DGV46109058.DataSource = irvan
    End Sub
    Private Sub butoon2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button146109058.Click
    If latihan25b46109058.Visible = False Then
    latihan25b46109058.Show()
    Else
    latihan25b46109058.Activate()
    End If
    baris = irvan.DefaultView(BindingContext(irvan).Position).Row
    latihan25b46109058.TextBox146109058.Text = baris("KODEBARANG")
    latihan25b46109058.TextBox246109058.Text = baris("NAMABARANG")
    latihan25b46109058.TextBox346109058.Text = baris("HARGAJUAL")
    latihan25b46109058.TextBox446109058.Text = baris("PERSEDIAANAWAL")
    latihan25b46109058.AmbilData()
    End Sub

    End Class
    Public Class latihan25b46109058


    Dim konek As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source =d:\berbagi\sharing2\LATIHAN 15-26 MENGAKSES DATA\DataTransaksiJualBeli.accdb")
    Dim tesji As New DataTable
    Dim cobaji As New OleDb.OleDbDataAdapter
    Public Sub AmbilData()
    cobaji = New OleDb.OleDbDataAdapter("select DETAILTRANSAKSI.ID,DETAILTRANSAKSI.NOTRANS,DETAILTRANSAKSI.KODEBARANG, DETAILTRANSAKSI.UNIT, DETAILTRANSAKSI.HARGA from DETAILTRANSAKSI where KODEBARANG ='" & TextBox146109058.Text & "'", konek)
    cobaji.Fill(tesji)
    End Sub

    Private Sub latihan25b46109058_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    AmbilData()
    DataGridView146109058.DataSource = tesji
    End Sub
    End Class

    BalasHapus
  16. Public Class latihan26a46109058

    Dim konek As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source =d:\berbagi\sharing2\LATIHAN 15-26 MENGAKSES DATA\DataTransaksiJualBeli.accdb")
    Dim irvan As New DataTable
    Dim baris As DataRow
    Dim cobaji As New OleDb.OleDbDataAdapter
    Private Sub latihan26a46109058_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    cobaji = New OleDb.OleDbDataAdapter("select * from BARANG", konek)
    cobaji.Fill(irvan)
    DGV46109058.DataSource = irvan
    End Sub
    Private Sub Button146109058_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button146109058.Click
    If latihan26b46109058.Visible = False Then
    latihan26b46109058.Show()
    Else
    latihan26b46109058.Activate()
    End If
    baris = irvan.DefaultView(BindingContext(irvan).Position).Row
    latihan26b46109058.TB146109058.Text = baris("KODEBARANG")
    latihan26b46109058.TB246109058.Text = baris("NAMABARANG")
    latihan26b46109058.TB346109058.Text = baris("HARGAJUAL")
    latihan26b46109058.TB446109058.Text = baris("PERSEDIAANAWAL")
    latihan26b46109058.AmbilData()

    End Sub
    End Class
    Public Class latihan26b46109058

    Dim konek As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source =d:\berbagi\sharing2\LATIHAN 15-26 MENGAKSES DATA\DataTransaksiJualBeli.accdb")
    Dim tesji As New DataTable
    Dim cobaji As New OleDb.OleDbDataAdapter
    Public Sub AmbilData()
    cobaji = New OleDb.OleDbDataAdapter("select DETAILTRANSAKSI.ID,DETAILTRANSAKSI.NOTRANS,DETAILTRANSAKSI.KODEBARANG, DETAILTRANSAKSI.UNIT, DETAILTRANSAKSI.HARGA from DETAILTRANSAKSI where KODEBARANG ='" & TB146109058.Text & "'", konek)
    cobaji.Fill(tesji)
    Dim tu, total As Integer
    For Each x As DataRow In tesji.Rows
    tu = tu + x("UNIT")
    total = total + x("HARGA")
    Next
    TB546109058.Text = tu
    TB646109058.Text = total
    End Sub
    Private Sub latihan26b46109058_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    AmbilData()
    DGV146109058.DataSource = tesji
    End Sub
    End Class

    BalasHapus
  17. Komentar ini telah dihapus oleh pengarang.

    BalasHapus
  18. Public Class Latihan23A_46109050
    Dim DT As New DataTable
    Dim ODB As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source =" & Application.StartupPath & "\DataTransaksiJualBeli.accdb")

    Private Sub Latihan23A_46109050Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Dim a As New OleDb.OleDbDataAdapter
    a = New OleDb.OleDbDataAdapter("select * from mastertransaksi", ODB)
    a.Fill(DT)
    a.Dispose()
    QQ1_46109050.DataSource = DT
    End Sub

    Private Sub QQ2_46109050_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles QQ2_46109050.Click
    If Latihan23B_46109050.Visible = False Then
    Latihan23B_46109050.Show()
    Else
    Latihan23B_46109050.Activate()
    End If
    Latihan23B_46109050.QQ1_46109050.Text = QQ1_46109050.CurrentRow.Cells("notrans").Value
    Latihan23B_46109050.QQ2_46109050.Text = QQ1_46109050.CurrentRow.Cells("tanggaltransaksi").Value
    Latihan23B_46109050.QQ3_46109050.Text = QQ1_46109050.CurrentRow.Cells("jenistransaksi").Value

    Latihan23B_46109050.RISKY(Latihan23B_46109050.QQ1_46109050.Text)
    End Sub
    End Class











    Public Class Latihan23B_46109050

    Dim DT As New DataTable
    Dim ODB As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source =" & Application.StartupPath & "\DataTransaksiJualBeli.accdb")

    Private Sub Latihan23B_46109050Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    QQ4_46109050.DataSource = DT
    End Sub

    Public Sub RISKY(ByVal MAHIRA As String)
    Dim a As New OleDb.OleDbDataAdapter
    Dim b As String
    b = "select id, kodebarang, unit, harga from detailtransaksi where notrans = '" & MAHIRA & "'"
    a = New OleDb.OleDbDataAdapter(b, ODB)
    a.Fill(DT)
    End Sub
    End Class

    BalasHapus
  19. PublicClass Latihan25A_46109050
    Dim dt AsNew DataTable
    Dim ODB AsNew OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source ="& Application.StartupPath &"\DataTransaksiJualBeli.accdb")

    PrivateSub Latihan25A_46109050Load(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesMyBase.Load
    Dim a AsNew OleDb.OleDbDataAdapter
    a = New OleDb.OleDbDataAdapter("select * from barang", ODB)
    a.Fill(dt)
    a.Dispose()
    QQ1_46109050.DataSource = dt
    EndSub

    PrivateSub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    If Latihan25B_46109050.Visible = FalseThen
    Latihan25B_46109050.Show()
    Else
    Latihan25B_46109050.Activate()
    EndIf
    Latihan25B_46109050.aa.Text = QQ1_46109050.CurrentRow.Cells("kodebarang").Value
    Latihan25B_46109050.bb.Text = QQ1_46109050.CurrentRow.Cells("namabarang").Value
    Latihan25B_46109050.cc.Text = QQ1_46109050.CurrentRow.Cells("hargajual").Value
    Latihan25B_46109050.dd.Text = QQ1_46109050.CurrentRow.Cells("persediaanawal").Value

    Latihan25B_46109050.RISKY(Latihan25B_46109050.aa.Text)
    EndSub
    EndClass










    PublicClass Latihan25B_46109050
    Dim dt AsNew DataTable
    Dim ODB AsNew OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source ="& Application.StartupPath &"\DataTransaksiJualBeli.accdb")

    PrivateSub Latihan25B_46109050Load(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesMyBase.Load
    QQ1_46109050.DataSource = dt
    EndSub

    PublicSub RISKY(ByVal MAHIRA AsString)
    Dim a AsNew OleDb.OleDbDataAdapter
    Dim b AsString
    b = "SELECT MASTERTRANSAKSI.NOTRANS, MASTERTRANSAKSI.TANGGALTRANSAKSI, MASTERTRANSAKSI.JENISTRANSAKSI, MASTERTRANSAKSI.KETERANGAN, DETAILTRANSAKSI.UNIT, DETAILTRANSAKSI.HARGA, [DETAILTRANSAKSI]![UNIT]*[DETAILTRANSAKSI]![HARGA] AS JUMLAH FROM DETAILTRANSAKSI INNER JOIN MASTERTRANSAKSI ON DETAILTRANSAKSI.NOTRANS = MASTERTRANSAKSI.NOTRANS WHERE KODEBARANG = '"& MAHIRA &"'"
    a = New OleDb.OleDbDataAdapter(b, ODB)
    a.Fill(dt)
    EndSub
    EndClass

    BalasHapus
  20. PublicClass Latihan26A_46109050
    Dim dt AsNew DataTable
    Dim ODB AsNew OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source ="& Application.StartupPath &"\DataTransaksiJualBeli.accdb")

    PrivateSub Latihan26A_46109050Load(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesMyBase.Load
    Dim a AsNew OleDb.OleDbDataAdapter
    a = New OleDb.OleDbDataAdapter("select * from barang", ODB)
    a.Fill(dt)
    a.Dispose()
    QQ1_46109050.DataSource = dt
    EndSub

    PrivateSub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    If Latihan26B_46109050.Visible = FalseThen
    Latihan26B_46109050.Show()
    Else
    Latihan26B_46109050.Activate()
    EndIf
    Latihan26B_46109050.aa.Text = QQ1_46109050.CurrentRow.Cells("kodebarang").Value
    Latihan26B_46109050.bb.Text = QQ1_46109050.CurrentRow.Cells("namabarang").Value
    Latihan26B_46109050.cc.Text = QQ1_46109050.CurrentRow.Cells("hargajual").Value
    Latihan26B_46109050.dd.Text = QQ1_46109050.CurrentRow.Cells("persediaanawal").Value

    Latihan26B_46109050.RISKY(Latihan26B_46109050.aa.Text)

    EndSub
    EndClass










    PublicClass Latihan26B_46109050
    Dim dt AsNew DataTable
    Dim ODB AsNew OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source ="& Application.StartupPath &"\DataTransaksiJualBeli.accdb")

    PrivateSub Latihan26B_46109050Load(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesMyBase.Load
    QQ1_46109050.DataSource = dt
    EndSub

    PublicSub RISKY(ByVal MAHIRA AsString)
    Dim a AsNew OleDb.OleDbDataAdapter
    Dim b AsString
    b = "SELECT MASTERTRANSAKSI.NOTRANS, MASTERTRANSAKSI.TANGGALTRANSAKSI, MASTERTRANSAKSI.JENISTRANSAKSI, MASTERTRANSAKSI.KETERANGAN, DETAILTRANSAKSI.UNIT, DETAILTRANSAKSI.HARGA, [DETAILTRANSAKSI]![UNIT]*[DETAILTRANSAKSI]![HARGA] AS JUMLAH FROM DETAILTRANSAKSI INNER JOIN MASTERTRANSAKSI ON DETAILTRANSAKSI.NOTRANS = MASTERTRANSAKSI.NOTRANS WHERE KODEBARANG = '"& MAHIRA &"'"
    a = New OleDb.OleDbDataAdapter(b, ODB)
    a.Fill(dt)

    Dim MAHIRA1 AsInteger = 0
    Dim MAHIRA2 AsInteger = 0
    ForEach MAHIRA3 As DataRow In dt.Rows
    MAHIRA1 += MAHIRA3("Unit")
    MAHIRA2 += MAHIRA3("Jumlah")
    Next
    ee.Text = MAHIRA1
    ff.Text = MAHIRA2
    EndSub
    EndClass

    BalasHapus
  21. PublicClass Latihan24A_46109050
    Dim dt AsNew DataTable
    Dim ODB AsNew OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source ="& Application.StartupPath &"\DataTransaksiJualBeli.accdb")

    PrivateSub Latihan24A_46109050Load(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesMyBase.Load
    Dim a AsNew OleDb.OleDbDataAdapter
    a = New OleDb.OleDbDataAdapter("select * from barang", ODB)
    a.Fill(dt)
    a.Dispose()
    QQ1_46109050.DataSource = dt
    EndSub

    PrivateSub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    If Latihan24B_46109050.Visible = FalseThen
    Latihan24B_46109050.Show()
    Else
    Latihan24B_46109050.Activate()
    EndIf
    Latihan24B_46109050.aa.Text = QQ1_46109050.CurrentRow.Cells("kodebarang").Value
    Latihan24B_46109050.bb.Text = QQ1_46109050.CurrentRow.Cells("namabarang").Value
    Latihan24B_46109050.cc.Text = QQ1_46109050.CurrentRow.Cells("hargajual").Value
    Latihan24B_46109050.dd.Text = QQ1_46109050.CurrentRow.Cells("persediaanawal").Value

    Latihan24B_46109050.RISKY(Latihan24B_46109050.aa.Text)
    EndSub
    EndClass










    PublicClass Latihan24B_46109050
    Dim dt AsNew DataTable
    Dim ODB AsNew OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source ="& Application.StartupPath &"\DataTransaksiJualBeli.accdb")

    PrivateSub Latihan24B_46109050Load(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesMyBase.Load
    QQ1_46109050.DataSource = dt
    EndSub

    PublicSub RISKY(ByVal MAHIRA AsString)
    Dim a AsNew OleDb.OleDbDataAdapter
    Dim b AsString
    b = "select id, notrans, unit, harga from detailtransaksi where kodebarang = '"& MAHIRA &"'"
    a = New OleDb.OleDbDataAdapter(b, ODB)
    a.Fill(dt)
    EndSub
    EndClass

    BalasHapus
  22. Public Class latihan24a46109026
    Dim koneksi As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\datatransaksijualbeli.accdb")
    Dim tabel As New DataTable

    Private Sub latihan24a46109026_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Dim adapter As New OleDb.OleDbDataAdapter
    adapter = New OleDb.OleDbDataAdapter("select*from barang inner join detailtransaksi on barang.kodebarang = detailtransaksi.kodebarang", koneksi)
    tabel.Rows.Clear()
    adapter.Fill(tabel)
    adapter.Dispose()

    dtg46109026.DataSource = tabel
    End Sub

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

    latihan24b46109026.tb146109026.Text = dtg46109026.CurrentRow.Cells("barang.kodebarang").Value
    latihan24b46109026.tb246109026.Text = dtg46109026.CurrentRow.Cells("namabarang").Value
    latihan24b46109026.tb346109026.Text = dtg46109026.CurrentRow.Cells("harga").Value
    latihan24b46109026.tb346109026.Text = dtg46109026.CurrentRow.Cells("unit").Value

    latihan24b46109026.uly(latihan24b46109026.tb146109026.Text)

    End Sub

    Private Sub dtg46109026_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dtg46109026.CellContentClick

    End Sub
    End Class

    Public Class latihan24b46109026
    Dim koneksi As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\datatransaksijualbeli.accdb")
    Dim tabel As New DataTable
    Private Sub latihan24b46109026_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub
    Public Sub uly(ByVal a As String)
    Dim adapter As New oledb.oledbdataadapter
    adapter = New OleDb.OleDbDataAdapter("select id, notrans, unit, harga from detailtransaksi where kodebarang='" & a & "'", koneksi)
    tabel.Rows.Clear()
    adapter.fill(tabel)
    adapter.dispose()

    dtg146109026.DataSource = tabel


    End Sub

    Private Sub dtg146109026_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dtg146109026.CellContentClick

    End Sub

    Private Sub tb446109026_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tb446109026.TextChanged

    End Sub

    Private Sub tb346109026_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tb346109026.TextChanged

    End Sub

    Private Sub tb246109026_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tb246109026.TextChanged

    End Sub

    Private Sub tb146109026_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tb146109026.TextChanged

    End Sub
    End Class

    BalasHapus
  23. Public Class latihan25a46109026
    Dim conect As New OleDb.OleDbConnection("provider=microsoft.ACE.oledb.12.0;data source=" & Application.StartupPath & "\datatransaksijualbeli.accdb")
    Dim datatable As New DataTable

    Private Sub latihan25a46109026_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Dim shoell As New OleDb.OleDbDataAdapter
    shoell = New OleDb.OleDbDataAdapter("select*from barang", conect)
    datatable.Rows.Clear()
    shoell.Fill(datatable)
    shoell.Dispose()

    dtg46109026.DataSource = datatable
    End Sub

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

    latihan25b46109026.tb146109026.Text = dtg46109026.CurrentRow.Cells("kodebarang").Value
    latihan25b46109026.tb246109026.Text = dtg46109026.CurrentRow.Cells("namabarang").Value
    latihan25b46109026.tb346109026.Text = dtg46109026.CurrentRow.Cells("hargajual").Value
    latihan25b46109026.tb446109026.Text = dtg46109026.CurrentRow.Cells("persediaanawal").Value

    latihan25b46109026.uly(latihan25b46109026.tb146109026.Text)

    End Sub

    Private Sub dtg46109026_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dtg46109026.CellContentClick

    End Sub
    End Class

    Public Class latihan25b46109026
    Dim koneksi As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\datatransaksijualbeli.accdb")
    Dim tabel As New DataTable

    Public Sub uly(ByVal A As String)
    Dim adapter As New OleDb.OleDbDataAdapter
    adapter = New OleDb.OleDbDataAdapter("select*from detailtransaksi where kodebarang='" & A & "'", koneksi)
    tabel.Rows.Clear()
    adapter.Fill(tabel)

    dtg146109026.DataSource = tabel
    End Sub

    Private Sub tb146109026_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tb146109026.TextChanged

    End Sub

    Private Sub tb246109026_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tb246109026.TextChanged

    End Sub

    Private Sub tb346109026_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tb346109026.TextChanged

    End Sub

    Private Sub latihan25b46109026_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub

    Private Sub tb446109026_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tb446109026.TextChanged

    End Sub

    Private Sub dtg146109026_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dtg146109026.CellContentClick

    End Sub
    End Class

    BalasHapus
  24. Public Class latihan26a46109026
    Dim conect As New OleDb.OleDbConnection("provider=microsoft.ACE.oledb.12.0;data source=" & Application.StartupPath & "\datatransaksijualbeli.accdb")
    Dim ibnu As New DataTable

    Private Sub latihan26a46109026_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Dim ibeng As New OleDb.OleDbDataAdapter
    ibeng = New OleDb.OleDbDataAdapter("select*from barang", conect)
    ibnu.Rows.Clear()
    ibeng.Fill(ibnu)
    ibeng.Dispose()

    dtg46109026.DataSource = ibnu

    End Sub

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

    latihan26b46109026.tb146109026.Text = dtg46109026.CurrentRow.Cells("kodebarang").Value
    latihan26b46109026.tb246109026.Text = dtg46109026.CurrentRow.Cells("namabarang").Value
    latihan26b46109026.tb346109026.Text = dtg46109026.CurrentRow.Cells("hargajual").Value
    latihan26b46109026.tb446109026.Text = dtg46109026.CurrentRow.Cells("persediaanawal").Value

    latihan26b46109026.uly(latihan26b46109026.tb146109026.Text)

    End Sub

    Private Sub dtg46109026_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dtg46109026.CellContentClick

    End Sub
    End Class

    Public Class latihan26b46109026
    Dim koneksi As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\datatransaksijualbeli.accdb")
    Dim saso As New DataTable
    Public Sub uly(ByVal A As String)
    Dim adapter As New OleDb.OleDbDataAdapter
    Dim ibeng As String
    ibeng = "SELECT MASTERTRANSAKSI.NOTRANS, MASTERTRANSAKSI.TANGGALTRANSAKSI, MASTERTRANSAKSI.JENISTRANSAKSI, MASTERTRANSAKSI.KETERANGAN, DETAILTRANSAKSI.UNIT, DETAILTRANSAKSI.HARGA, [DETAILTRANSAKSI]![UNIT]*[DETAILTRANSAKSI]![HARGA] AS JUMLAH FROM DETAILTRANSAKSI INNER JOIN MASTERTRANSAKSI ON DETAILTRANSAKSI.NOTRANS = MASTERTRANSAKSI.NOTRANS WHERE KODEBARANG = '" & A & "'"
    adapter = New OleDb.OleDbDataAdapter(ibeng, koneksi)
    adapter.Fill(saso)

    Dim ibnu As Integer = 0
    Dim terry As Integer = 0
    For Each row As DataRow In saso.Rows
    ibnu += row("Unit")
    terry += row("Jumlah")
    Next
    tb546109026.Text = ibnu
    tb646109026.Text = terry

    End Sub

    Private Sub latihan26b46109026_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    dtg46109026.DataSource = saso
    End Sub

    Private Sub tb146109026_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tb146109026.TextChanged

    End Sub

    Private Sub tb246109026_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tb246109026.TextChanged

    End Sub

    Private Sub tb346109026_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tb346109026.TextChanged

    End Sub

    Private Sub tb446109026_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tb446109026.TextChanged

    End Sub

    Private Sub dtg46109026_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dtg46109026.CellContentClick

    End Sub

    Private Sub tb546109026_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tb546109026.TextChanged

    End Sub

    Private Sub tb646109026_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tb646109026.TextChanged

    End Sub
    End Class

    BalasHapus
  25. Public Class Form23A
    Dim DT As New DataTable
    Dim vesa As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source =" & Application.StartupPath & "\DataTransaksiJualBeli.accdb")

    Private Sub Form23A_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Dim deka As New OleDb.OleDbDataAdapter
    deka = New OleDb.OleDbDataAdapter("select * from mastertransaksi", vesa)
    deka.Fill(DT)
    deka.Dispose()
    DGV1_052.DataSource = DT
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    If Form23B.Visible = False Then
    Form23B.Show()
    Else
    Form23B.Activate()
    End If
    Form23B.vero1.Text = DGV1_052.CurrentRow.Cells("notrans").Value
    Form23B.DTP.Text = DGV1_052.CurrentRow.Cells("tanggaltransaksi").Value
    Form23B.vero3.Text = DGV_052.CurrentRow.Cells("jenistransaksi").Value

    Form23B.nika(Form23B.vero1.Text)
    End Sub
    End Class

    Public Class Form23B
    Dim DT As New DataTable
    Dim vesa As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source =" & Application.StartupPath & "\DataTransaksiJualBeli.accdb")

    Private Sub Form23B_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    DGV1_052.DataSource = DT
    End Sub

    Public Sub vero(ByVal nika As String)
    Dim de As New OleDb.OleDbDataAdapter
    Dim ka As String
    ka = "select id, kodebarang, unit, harga from detailtransaksi where notrans = '" & nika & "'"
    de = New OleDb.OleDbDataAdapter(ka, vesa)
    de.Fill(DT)
    End Sub
    End Class

    Public Class Form24A
    Dim DT As New DataTable
    Dim vesa As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source =" & Application.StartupPath & "\DataTransaksiJualBeli.accdb")

    Private Sub Form24A_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Dim de As New OleDb.OleDbDataAdapter
    de = New OleDb.OleDbDataAdapter("select * from barang", vesa)
    de.Fill(dt)
    de.Dispose()
    DGV1_052.DataSource = DT
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    If Form24B.Visible = False Then
    Form24B.Show()
    Else
    Form24B.Activate()
    End If
    Form24B.nika1.Text = DGV1_052.CurrentRow.Cells("kodebarang").Value
    Form24B.nika2.Text = DGV1_052.CurrentRow.Cells("namabarang").Value
    Form24B.nika3.Text = DGV1_052.CurrentRow.Cells("hargajual").Value
    Form24B.nika4.Text = DGV1_052.CurrentRow.Cells("persediaanawal").Value

    Form24B.vero(Form24B.nika1.Text)
    End Sub
    End Class

    BalasHapus
  26. Public Class Form25B
    Dim vesa As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\datatransaksijualbeli.accdb")
    Dim tabel As New DataTable

    Public Sub VERO(ByVal de As String)
    Dim adapter As New OleDb.OleDbDataAdapter
    adapter = New OleDb.OleDbDataAdapter("select*from detailtransaksi where kodebarang='" & de & "'", vesa)
    tabel.Rows.Clear()
    adapter.Fill(tabel)

    DGV1_052.DataSource = tabel
    End Sub
    End Class




    Public Class Form26A
    Dim denka As New OleDb.OleDbConnection("provider=microsoft.ACE.oledb.12.0;data source=" & Application.StartupPath & "\datatransaksijualbeli.accdb")
    Dim VESA As New DataTable
    Private Sub Form26a_46109052_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Dim VESA As New OleDb.OleDbDataAdapter
    VESA = New OleDb.OleDbDataAdapter("select*from barang", denka)
    VESA.Rows.Clear()
    VESA.Fill(VESA)
    VESA.Dispose()

    DGV1_052.DataSource = VESA

    End Sub

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

    Form26B.nika1_052.Text = DGV1_052.CurrentRow.Cells("kodebarang").Value
    Form26B.nika2_052.Text = DGV1_052.CurrentRow.Cells("namabarang").Value
    Form26B.nika3_052.Text = DGV1_052.CurrentRow.Cells("hargajual").Value
    Form26B.nika4_052.Text = DGV1_052.CurrentRow.Cells("persediaanawal").Value

    Form26B.VERO(Form26B.nika1_052.Text)

    End Sub
    End Class

    Public Class Form26B

    Dim vesa As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\datatransaksijualbeli.accdb")
    Dim tabel As New DataTable

    Public Sub VERO(ByVal A As String)
    Dim do As New OleDb.OleDbDataAdapter
    Dim re As String
    re = "SELECT MASTERTRANSAKSI.NOTRANS, MASTERTRANSAKSI.TANGGALTRANSAKSI, MASTERTRANSAKSI.JENISTRANSAKSI, MASTERTRANSAKSI.KETERANGAN, DETAILTRANSAKSI.UNIT, DETAILTRANSAKSI.HARGA, [DETAILTRANSAKSI]![UNIT]*[DETAILTRANSAKSI]![HARGA] AS JUMLAH FROM DETAILTRANSAKSI INNER JOIN MASTERTRANSAKSI ON DETAILTRANSAKSI.NOTRANS = MASTERTRANSAKSI.NOTRANS WHERE KODEBARANG = '" & de & "'"
    do = New OleDb.OleDbDataAdapter(re, vesa)
    do.Fill(tabel)

    Dim nika1 As Integer = 0
    Dim nika2 As Integer = 0
    For Each nika3 As DataRow In tabel.Rows
    nika1 += nika3("Unit")
    nika2 += nika3("Jumlah")
    Next
    NIKA5_052.Text = nika1
    NIKA6_052.Text = nika2

    End Sub
    End Class

    BalasHapus