Public Class LATIHAN_035_36109056 Dim CONECT As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\DATAMAJEMUK.accdb;Jet OLEDB:Database Password=2422") Dim DT As New DataTable Dim cari As New ByIskandar.CariKeDataBaseByIskandar Private Sub LATIHAN035012_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim biya As New OleDb.OleDbDataAdapter biya = New OleDb.OleDbDataAdapter("select KODEBARANG, UNIT, HARGA FROM DETAILTRANSAKSI WHERE NOTRANS= '" & KB_36109056.Text & "'", CONECT) DT.Rows.Clear() biya.Fill(DT) DataGridView1.DataSource = DT biya.Dispose() End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If KB_36109056.Text.Length = 0 Then MsgBox("kode barang belum terisi") Exit Sub End If
If Val(UN_36109056.Text) = 0 Then MsgBox("UNIT belum terisi") Exit Sub End If
If Val(HR_36109056.Text) = 0 Then MsgBox("HARGA belum terisi") Exit Sub End If
KB_36109056.Text = "" UN_36109056.Text = "" HR_36109056.Text = "" End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click If TextBox1_36109056.Text.Length = 0 Then MsgBox("no.transaksi belum terisi") Exit Sub End If
If TextBox2_36109056.Text.Length = 0 Then MsgBox("jenis transaksi belum terisi") Exit Sub End If
If cari.JumlanBaris > 0 Then MsgBox("NO.TRANS sudah ada") Exit Sub End If
If DT.Rows.Count = 0 Then MsgBox("data tidak tersedia") End If
Dim com As New OleDb.OleDbCommand com = New OleDb.OleDbCommand("insert into mastertransaksi (notrans, tanggaltransaksi, jenistransaksi) values ('" & TextBox1_36109056.Text & "',#" & DateTimePicker1.Value.Date & "#," & Val(TextBox2_36109056.Text) & ")", CONECT)
Public Class LATIHAN03536109033 Dim CONECT As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\DATAMAJEMUK.accdb;Jet OLEDB:Database Password=tahir") Dim Data As New DataTable Dim browse As New ByIskandar.CariKeDataBaseByIskandar
Private Sub LATIHAN03536109033_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim tiwi As New OleDb.OleDbDataAdapter tiwi = New OleDb.OleDbDataAdapter("select KODEBARANG, UNIT, HARGA FROM DETAILTRANSAKSI WHERE NOTRANS= '" & KB36109033.Text & "'", CONECT) Data.Rows.Clear() tiwi.Fill(Data) DataGridView1.DataSource = Data tiwi.Dispose() End Sub
Private Sub Button136109033_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button136109033.Click If KB36109033.Text.Length = 0 Then MsgBox("kode barang belum terisi") Exit Sub End If
If Val(UN36109033.Text) = 0 Then MsgBox("UNIT belum terisi") Exit Sub End If
If Val(HR36109033.Text) = 0 Then MsgBox("HARGA belum terisi") Exit Sub End If
KB36109033.Text = "" UN36109033.Text = "" HR36109033.Text = "" End Sub
Private Sub Button336109033_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button336109033.Click If TextBox136109033.Text.Length = 0 Then MsgBox("no.transaksi belum terisi") Exit Sub End If
If TextBox236109033.Text.Length = 0 Then MsgBox("jenis transaksi belum terisi") Exit Sub End If
If browse.JumlanBaris > 0 Then MsgBox("NO.TRANS sudah ada") Exit Sub End If
If Data.Rows.Count = 0 Then MsgBox("data tidak tersedia") End If
Dim com As New OleDb.OleDbCommand com = New OleDb.OleDbCommand("insert into mastertransaksi (notrans, tanggaltransaksi, jenistransaksi) values ('" & TextBox136109033.Text & "',#" & DateTimePicker136109033.Value.Date & "#," & Val(TextBox236109033.Text) & ")", CONECT)
Public Class LATIHAN35035 Dim Jalan As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source =" & Application.StartupPath & "\Datamajemuk.ACCDB") Dim gitik As New DataTable
Private Sub Latihan35_083_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'mendeklarasikan kendaraan Dim bojel As New OleDb.OleDbDataAdapter
'Mengatur data yang akan di angkut bojel = New OleDb.OleDbDataAdapter("SELECT kodebarang,unit,harga FROM DETAILTRANSAKSI where notrans='" & TextBox1035.Text & "'", Jalan)
'bersihkan data gitik.Rows.Clear()
'untuk memasukkan data yg telah di angkut ke dalam datatable bojel.Fill(gitik)
'untuk menampilkan isi datatable ke data grid view bojel.Dispose() DataGridView1035.DataSource = gitik
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1035.Click 'Memeriksa isi textbox If KB035.Text.Length = 0 Then MsgBox("Please, insert the code of goods") Exit Sub End If
If UN035.Text.Length = 0 Then MsgBox("Please, insert the unit of goods") Exit Sub End If
If HR035.Text.Length = 0 Then MsgBox("Please, insert the cost of goods") Exit Sub End If
'penyimpanan data ke datatable gitik.Rows.Add((KB035.Text), Val(UN035.Text), Val(HR035.Text))
'mengosongkan textbox KB035.Text = "" UN035.Text = "" HR035.Text = "" End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3035.Click 'Memeriksa isi textbox If TextBox1035.Text.Length = 0 Then MsgBox("Please, insert the Number of the transaction") Exit Sub End If
If TextBox2035.Text.Length = 0 Then MsgBox("Please, insert the type of the transaction") Exit Sub End If
If gitik.Rows.Count = 0 Then MsgBox("the data is none") Exit Sub End If
'Memeriksa nomor transaksi pd master transaksi Dim search As New ByIskandar.CariKeDataBaseByIskandar search.AturPencarianDataBase("mastertransaksi", "notrans", TextBox1035.Text, 1, Jalan) If search.JumlanBaris > 0 Then MsgBox("the code has been exist") Exit Sub End If
'Proses Penyimpanan ke tabel master transaksi Dim kacci As New OleDb.OleDbCommand kacci = New OleDb.OleDbCommand("insert into mastertransaksi (notrans,tanggaltransaksi,jenistransaksi) values ('" & TextBox1035.Text & "',#" & DateTimePicker1035.Value.Month & "/" & DateTimePicker1035.Value.Day & "/" & DateTimePicker1035.Value.Year & "#,'" & TextBox2035.Text & "')", Jalan) Jalan.Open() kacci.ExecuteNonQuery() Jalan.Close()
'penyimpanan isi datatable ke detail transaksi For Each nhana As DataRow In gitik.Rows kacci = New OleDb.OleDbCommand("insert into detailtransaksi (notrans,kodebarang,unit,harga) values ('" & TextBox1035.Text & "','" & nhana("kodebarang") & "'," & nhana("unit") & "," & nhana("harga") & ")", Jalan) Jalan.Open() kacci.ExecuteNonQuery() Jalan.Close()
Next kacci.Dispose()
'Mengosongkan isi text box TextBox1035.Text = "" TextBox2035.Text = ""
Public Class Form3536109040 Dim CONECT As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\DATAMAJEMUK.accdb;Jet OLEDB:Database Password=150991") Dim DT As New DataTable Dim cari As New ByIskandar.CariKeDataBaseByIskandar Private Sub LATIHAN035012_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim mita As New OleDb.OleDbDataAdapter biya = New OleDb.OleDbDataAdapter("select KODEBARANG, UNIT, HARGA FROM DETAILTRANSAKSI WHERE NOTRANS= '" & KB_36109040.Text & "'", CONECT) DT.Rows.Clear() mita.Fill(DT) DataGridView1.DataSource = DT mita.Dispose() End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If KB_36109040.Text.Length = 0 Then MsgBox("kode barang belum terisi") Exit Sub End If
If Val(UN_36109040.Text) = 0 Then MsgBox("UNIT belum terisi") Exit Sub End If
If Val(HR_36109040.Text) = 0 Then MsgBox("HARGA belum terisi") Exit Sub End If
KB_36109040.Text = "" UN_36109040.Text = "" HR_36109040.Text = "" End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click If TextBox1_36109040.Text.Length = 0 Then MsgBox("no.transaksi belum terisi") Exit Sub End If
If TextBox2_36109040.Text.Length = 0 Then MsgBox("jenis transaksi belum terisi") Exit Sub End If
If cari.JumlanBaris > 0 Then MsgBox("NO.TRANS sudah ada") Exit Sub End If
If DT.Rows.Count = 0 Then MsgBox("data tidak tersedia") End If
Dim com As New OleDb.OleDbCommand com = New OleDb.OleDbCommand("insert into mastertransaksi (notrans, tanggaltransaksi, jenistransaksi) values ('" & TextBox1_36109040.Text & "',#" & DateTimePicker1.Value.Date & "#," & Val(TextBox2_36109040.Text) & ")", CONECT)
Public Class LATIHAN035_36109049 'DEKLARASI CONECTION Dim CONECT As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\DATAMAJEMUK.accdb;Jet OLEDB:Database Password=wirda") 'deklarasi data tabel Dim wirda As New DataTable Dim wirdapaulus As New ByIskandar.CariKeDataBaseByIskandar
Private Sub LATIHAN035_36109049_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'deklarasi adapter Dim poltek As New OleDb.OleDbDataAdapter poltek = New OleDb.OleDbDataAdapter("select KODEBARANG, UNIT, HARGA FROM DETAILTRANSAKSI WHERE NOTRANS= '" & KB_36109049.Text & "'", CONECT) 'memunculkan semua data dari tabel barang dlm acces wirda.Rows.Clear() 'membersihkan data table poltek.Fill(wirda) 'mengisi database ke dlm data table DataGridView1.DataSource = wirda 'memunculkan dlm datagridview
poltek.Dispose() 'menghancurkan kendaraan (adapter) yg sdh dipake
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click 'untuk mencari jgn sampai data yg akan dimasukkan tidak lengkap If KB_36109049.Text.Length = 0 Then 'untuk pencarian yang bersifat angka MsgBox("kode barang belum terisi") Exit Sub 'jgn lanjut ke proses berikutnya End If
If Val(UN_36109049.Text) = 0 Then 'untuk pencarian yang bersifat angka MsgBox("UNIT belum terisi") Exit Sub 'jgn lanjut ke proses berikutnya End If
If Val(HR_36109049.Text) = 0 Then 'untuk pencarian yang bersifat angka MsgBox("HARGA belum terisi") Exit Sub 'jgn lanjut ke proses berikutnya End If
'UNTUK MENYMPAN DATA YG DIMASUKKAN KE DALAM DATAGRIDVIEW Dim apkom As DataRow
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click 'untuk mencari jgn sampai data yg akan dimasukkan tidak lengkap If TextBox1_36109049.Text.Length = 0 Then 'untuk pencarian yang bersifat angka MsgBox("no.transaksi belum terisi") Exit Sub 'jgn lanjut ke proses berikutnya End If
If TextBox2_36109049.Text.Length = 0 Then 'untuk pencarian yang bersifat angka MsgBox("jenis transaksi belum terisi") Exit Sub 'jgn lanjut ke proses berikutnya End If
'untuk mencari jgn sampai data yg akan dimasukkan sudah ada wirdapaulus.AturPencarianDataBase("mastertransaksi", "notrans", TextBox1_36109049.Text, 1, CONECT)
If wirdapaulus.JumlanBaris > 0 Then MsgBox("NO.TRANS sudah ada") Exit Sub End If
If wirda.Rows.Count = 0 Then MsgBox("data tidak tersedia") End If
'untuk memasukkan data dari visual basc ke dlm acces Dim com As New OleDb.OleDbCommand com = New OleDb.OleDbCommand("insert into mastertransaksi (notrans, tanggaltransaksi, jenistransaksi) values ('" & TextBox1_36109049.Text & "',#" & DateTimePicker1.Value.Date & "#," & Val(TextBox2_36109049.Text) & ")", CONECT)
Public Class LATIHAN03536109038 Dim CONECT As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\DATAMAJEMUK.accdb;Jet OLEDB:Database Password=icha") Dim DT As New DataTable Dim cari As New ByIskandar.CariKeDataBaseByIskandar
Private Sub LATIHAN03536109038_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim Azizah As New OleDb.OleDbDataAdapter Azizah = New OleDb.OleDbDataAdapter("select KODEBARANG, UNIT, HARGA FROM DETAILTRANSAKSI WHERE NOTRANS= '" & KB36109038.Text & "'", CONECT) DT.Rows.Clear() Azizah.Fill(DT) DataGridView136109038.DataSource = DT
Azizah.Dispose() End Sub
Private Sub Button136109038_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button136109038.Click If KB36109038.Text.Length = 0 Then MsgBox("kode barang belum terisi") Exit Sub End If
If Val(UN36109038.Text) = 0 Then MsgBox("UNIT belum terisi") Exit Sub End If
If Val(HR36109038.Text) = 0 Then MsgBox("HARGA belum terisi") Exit Sub End If
KB36109038.Text = "" UN36109038.Text = "" HR36109038.Text = "" End Sub
Private Sub Button336109038_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button336109038.Click If TextBox136109038.Text.Length = 0 Then MsgBox("no.transaksi belum terisi") Exit Sub End If
If TextBox236109038.Text.Length = 0 Then MsgBox("jenis transaksi belum terisi") Exit Sub End If
If cari.JumlanBaris > 0 Then MsgBox("NO.TRANS sudah ada") Exit Sub End If
If DT.Rows.Count = 0 Then MsgBox("data tidak tersedia") End If
Dim com As New OleDb.OleDbCommand com = New OleDb.OleDbCommand("insert into mastertransaksi (notrans, tanggaltransaksi, jenistransaksi) values ('" & TextBox136109038.Text & "',#" & DateTimePicker136109038.Value.Date & "#," & Val(TextBox236109038.Text) & ")", CONECT)
Dim sambung As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\DATAMAJEMUK.accdb;Jet OLEDB:Database Password=jayapura") Dim toshiba As New DataTable Dim nokia As New ByIskandar.CariKeDataBaseByIskandar
Private Sub LATIHAN03536109032_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim laptop As New OleDb.OleDbDataAdapter laptop = New OleDb.OleDbDataAdapter("select KODEBARANG, UNIT, HARGA FROM DETAILTRANSAKSI WHERE NOTRANS= '" & KB.Text & "'", sambung) toshiba.Rows.Clear() laptop.Fill(toshiba) DataGridView1.DataSource = toshiba laptop.Dispose()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If KB.Text.Length = 0 Then MsgBox("kode barang belum terisi") Exit Sub End If
If Val(UN.Text) = 0 Then MsgBox("UNIT belum terisi") Exit Sub End If
If Val(HR.Text) = 0 Then MsgBox("HARGA belum terisi") Exit Sub End If
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click If TextBox1.Text.Length = 0 Then MsgBox("no.transaksi belum terisi") Exit Sub End If
If TextBox2.Text.Length = 0 Then MsgBox("jenis transaksi belum terisi") Exit Sub End If
If nokia.JumlanBaris > 0 Then MsgBox("NO.TRANS sudah ada") Exit Sub End If
If toshiba.Rows.Count = 0 Then MsgBox("data tidak tersedia") End If
Dim com As New OleDb.OleDbCommand com = New OleDb.OleDbCommand("insert into mastertransaksi (notrans, tanggaltransaksi, jenistransaksi) values ('" & TextBox1.Text & "',#" & DateTimePicker1.Value.Date & "#," & Val(TextBox2.Text) & ")", sambung)
Public Class LATIHAN035041 Dim CONECT As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\DATAMAJEMUK.accdb; Jet OLEDB:Database Password=12") Dim DT As New DataTable Dim cari As New ByIskandar.CariKeDataBaseByIskandar Private Sub LATIHAN035012_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim nisa As New OleDb.OleDbDataAdapter nisa = New OleDb.OleDbDataAdapter("select KODEBARANG, UNIT, HARGA FROM DETAILTRANSAKSI WHERE NOTRANS= '" & KB36109041.Text & "'", CONECT) nisa.Fill(DT) DataGridView1.DataSource = DT
nisa.Dispose()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If KB36109041.Text.Length = 0 Then MsgBox("kode barang belum terisi") Exit Sub End If
If Val(UN36109041.Text) = 0 Then MsgBox("UNIT belum terisi") Exit Sub End If
If Val(HR36109041.Text) = 0 Then MsgBox("HARGA belum terisi") Exit Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click If TextBox136109041.Text.Length = 0 Then MsgBox("no.transaksi belum terisi") Exit Sub End If
If TextBox236109041.Text.Length = 0 Then MsgBox("jenis transaksi belum terisi") Exit Sub End If
If cari.JumlanBaris > 0 Then MsgBox("NO.TRANS sudah ada") Exit Sub End If
If DT.Rows.Count = 0 Then MsgBox("data tidak tersedia") End If
Dim com As New OleDb.OleDbCommand com = New OleDb.OleDbCommand("insert into mastertransaksi (notrans, tanggaltransaksi, jenistransaksi) values ('" & TextBox136109041.Text & "',#" & DateTimePicker1.Value.Date & "#,'" & TextBox236109041.Text & "')", CONECT)
Public Class LATIHAN_03536109055 Dim CONECT As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\DATAMAJEMUK.accdb;Jet OLEDB:Database Password=2312") Dim DT As New DataTable Dim cari As New ByIskandar.CariKeDataBaseByIskandar Private Sub LATIHAN_03536109055_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim biya As New OleDb.OleDbDataAdapter biya = New OleDb.OleDbDataAdapter("select KODEBARANG, UNIT, HARGA FROM DETAILTRANSAKSI WHERE NOTRANS= '" & KB36109055.Text & "'", CONECT) DT.Rows.Clear() falah.Fill(DT) DataGridView136109055.DataSource = DT falah.Dispose() End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If KB36109055.Text.Length = 0 Then MsgBox("kode barang belum terisi") Exit Sub End If
If Val(UN36109055.Text) = 0 Then MsgBox("UNIT belum terisi") Exit Sub End If
If Val(HR36109055.Text) = 0 Then MsgBox("HARGA belum terisi") Exit Sub End If
KB36109055.Text = "" UN36109055.Text = "" HR36109055.Text = "" End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click If TextBox136109055.Text.Length = 0 Then MsgBox("no.transaksi belum terisi") Exit Sub End If
If TextBox236109055.Text.Length = 0 Then MsgBox("jenis transaksi belum terisi") Exit Sub End If
If cari.JumlanBaris > 0 Then MsgBox("NO.TRANS sudah ada") Exit Sub End If
If DT.Rows.Count = 0 Then MsgBox("data tidak tersedia") End If
Dim com As New OleDb.OleDbCommand com = New OleDb.OleDbCommand("insert into mastertransaksi (notrans, tanggaltransaksi, jenistransaksi) values ('" & TextBox136109055.Text & "',#" & DateTimePicker1.Value.Date & "#," & Val(TextBox236109055.Text) & ")", CONECT)
Part 1 Public Class LATIHAN03536109054 'DEKLARASI CONECTION Dim CONECT As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= D:\berbagi\LATIHAN 35-40 DATA MAJEMUK\DataMajemuk.accdb;Jet OLEDB:Database Password=salam") 'deklarasi data tabel Dim DT As New DataTable Dim cari As New ByIskandar.CariKeDataBaseByIskandar
Private Sub LATIHAN035012_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'deklarasi adapter Dim wawan As New OleDb.OleDbDataAdapter wawan = New OleDb.OleDbDataAdapter("select KODEBARANG, UNIT, HARGA FROM DETAILTRANSAKSI WHERE NOTRANS= '" & KB36109054.Text & "'", CONECT) 'memunculkan semua data dari tabel barang dlm acces DT.Rows.Clear() 'membersihkan data table wawan.Fill(DT) 'mengisi database ke dlm data table DGV136109054.DataSource = DT 'memunculkan dlm datagridview
wawan.Dispose() 'menghancurkan kendaraan (adapter) yg sdh dipake
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button136109054.Click 'untuk mencari jgn sampai data yg akan dimasukkan tidak lengkap If KB36109054.Text.Length = 0 Then 'untuk pencarian yang bersifat angka MsgBox("kode barang belum terisi") Exit Sub 'jgn lanjut ke proses berikutnya End If
If Val(UN36109054.Text) = 0 Then 'untuk pencarian yang bersifat angka MsgBox("UNIT belum terisi") Exit Sub 'jgn lanjut ke proses berikutnya End If
If Val(HR36109054.Text) = 0 Then 'untuk pencarian yang bersifat angka MsgBox("HARGA belum terisi") Exit Sub 'jgn lanjut ke proses berikutnya End If
'UNTUK MENYMPAN DATA YG DIMASUKKAN KE DALAM DATAGRIDVIEW Dim drzany As DataRow
Part 2 Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button336109054.Click 'untuk mencari jgn sampai data yg akan dimasukkan tidak lengkap If TextBox136109054.Text.Length = 0 Then 'untuk pencarian yang bersifat angka MsgBox("no.transaksi belum terisi") Exit Sub 'jgn lanjut ke proses berikutnya End If
If TextBox236109054.Text.Length = 0 Then 'untuk pencarian yang bersifat angka MsgBox("jenis transaksi belum terisi") Exit Sub 'jgn lanjut ke proses berikutnya End If
'untuk mencari jgn sampai data yg akan dimasukkan sudah ada cari.AturPencarianDataBase("mastertransaksi", "notrans", TextBox136109054.Text, 1, CONECT)
If cari.JumlanBaris > 0 Then MsgBox("NO.TRANS sudah ada") Exit Sub End If
If DT.Rows.Count = 0 Then MsgBox("data tidak tersedia") End If
'untuk memasukkan data dari visual basc ke dlm acces Dim com As New OleDb.OleDbCommand com = New OleDb.OleDbCommand("insert into mastertransaksi (notrans, tanggaltransaksi, jenistransaksi) values ('" & TextBox136109054.Text & "',#" & DTP136109054.Value.Date & "#,'" & TextBox236109054.Text & "')", CONECT)
Public Class Form3536109050 Dim CONECT As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\DATAMAJEMUK.accdb;Jet OLEDB:Database Password=nideria") Dim data As New DataTable Dim cari As New ByIskandar.CariKeDataBaseByIskandar
Private Sub Form3536109050_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim adapt As New OleDb.OleDbDataAdapter adapt = New OleDb.OleDbDataAdapter("select KODEBARANG, UNIT, HARGA FROM DETAILTRANSAKSI WHERE NOTRANS= '" & KB.Text & "'", CONECT) data.Rows.Clear() adapt.Fill(data) DataGridView1.DataSource = data adapt.Dispose() End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If KB.Text.Length = 0 Then MsgBox("kode barang belum terisi") Exit Sub End If
If Val(UN.Text) = 0 Then MsgBox("UNIT belum terisi") Exit Sub End If
If Val(HR.Text) = 0 Then MsgBox("HARGA belum terisi") Exit Sub End If
Dim simpan As DataRow simpan = data.NewRow simpan("KODEBARANG") = KB.Text simpan("UNIT") = UN.Text simpan("HARGA") = HR.Text data.Rows.Add(simpan)
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click If TextBox1.Text.Length = 0 Then MsgBox("no.transaksi belum terisi") Exit Sub End If
If TextBox2.Text.Length = 0 Then MsgBox("jenis transaksi belum terisi") Exit Sub End If
If cari.JumlanBaris > 0 Then MsgBox("NO.TRANS sudah ada") Exit Sub End If
If data.Rows.Count = 0 Then MsgBox("data tidak tersedia") End If
Dim com As New OleDb.OleDbCommand com = New OleDb.OleDbCommand("insert into mastertransaksi (notrans, tanggaltransaksi, jenistransaksi) values ('" & TextBox1.Text & "',#" & DateTimePicker1.Value.Date & "#," & Val(TextBox2.Text) & ")", CONECT)
For Each r As DataRow In data.Rows com = New OleDb.OleDbCommand("insert into detailtransaksi (notrans, kodebarang, unit, harga ) values ('" & TextBox1.Text & "','" & r("kodebarang") & "'," & r("unit") & "," & r("harga") & ")", CONECT) CONECT.Open() com.ExecuteNonQuery() CONECT.Close() com.Dispose() Next
data.Rows.Clear() TextBox1.Text = "" TextBox2.Text = "" End Sub End Class
'DEKLARASI CONECTION Dim CONNECT As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\DATAMAJEMUK.accdb;jet oledb:database password = hapsari") 'deklarasi data tabel Dim DT As New DataTable Dim cari As New ByIskandar.CariKeDataBaseByIskandar
Private Sub LATIHAN03536109029_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'deklarasi adapter Dim cute As New OleDb.OleDbDataAdapter cute = New OleDb.OleDbDataAdapter("select KODEBARANG, UNIT, HARGA FROM DETAILTRANSAKSI WHERE NOTRANS= '" & KB36109029.Text & "'", CONNECT) 'memunculkan semua data dari tabel barang dlm acces DT.Rows.Clear() 'membersihkan data table cute.Fill(DT) 'mengisi database ke dlm data table DataGridView1.DataSource = DT 'memunculkan dlm datagridview
cute.Dispose() 'menghancurkan kendaraan (adapter) yg sdh dipake
End Sub
Private Sub Button136109029_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button136109029.Click 'untuk mencari jgn sampai data yg akan dimasukkan tidak lengkap If KB36109029.Text.Length = 0 Then 'untuk pencarian yang bersifat angka MsgBox("kode barang belum terisi") Exit Sub 'jgn lanjut ke proses berikutnya End If
If Val(UN36109029.Text) = 0 Then 'untuk pencarian yang bersifat angka MsgBox("UNIT belum terisi") Exit Sub 'jgn lanjut ke proses berikutnya End If
If Val(HR36109029.Text) = 0 Then 'untuk pencarian yang bersifat angka MsgBox("HARGA belum terisi") Exit Sub 'jgn lanjut ke proses berikutnya End If
'UNTUK MENYMPAN DATA YG DIMASUKKAN KE DALAM DATAGRIDVIEW Dim indah As DataRow
Private Sub Button236109029_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button236109029.Click 'untuk mencari jgn sampai data yg akan dimasukkan tidak lengkap If TextBox136109029.Text.Length = 0 Then 'untuk pencarian yang bersifat angka MsgBox("no.transaksi belum terisi") Exit Sub 'jgn lanjut ke proses berikutnya End If
If TextBox236109029.Text.Length = 0 Then 'untuk pencarian yang bersifat angka MsgBox("jenis transaksi belum terisi") Exit Sub 'jgn lanjut ke proses berikutnya End If
'untuk mencari jgn sampai data yg akan dimasukkan sudah ada cari.AturPencarianDataBase("mastertransaksi", "notrans", TextBox136109029.Text, 1, CONNECT)
If cari.JumlanBaris > 0 Then MsgBox("NO.TRANS sudah ada") Exit Sub End If
If DT.Rows.Count = 0 Then MsgBox("data tidak tersedia") End If
'untuk memasukkan data dari visual basc ke dlm acces Dim com As New OleDb.OleDbCommand com = New OleDb.OleDbCommand("insert into mastertransaksi (notrans, tanggaltransaksi, jenistransaksi) values ('" & TextBox136109029.Text & "',#" & DateTimePicker1.Value.Date & "#," & Val(TextBox236109029.Text) & ")", CONNECT)
Public Class LATIHAN03536109036 Dim CONECT As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\DATAMAJEMUK.accdb;Jet OLEDB:Database Password=100191") Dim Data As New DataTable Dim browse As New ByIskandar.CariKeDataBaseByIskandar
Private Sub LATIHAN03536109036_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim ibnu As New OleDb.OleDbDataAdapter ibnu = New OleDb.OleDbDataAdapter("select KODEBARANG, UNIT, HARGA FROM DETAILTRANSAKSI WHERE NOTRANS= '" & KB36109036.Text & "'", CONECT) Data.Rows.Clear() ibnu.Fill(Data) DataGridView1.DataSource = Data ibnu.Dispose() End Sub
Private Sub Button136109036_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button136109036.Click If KB36109036.Text.Length = 0 Then MsgBox("kode barang belum terisi") Exit Sub End If
If Val(UN36109036.Text) = 0 Then MsgBox("UNIT belum terisi") Exit Sub End If
If Val(HR36109036.Text) = 0 Then MsgBox("HARGA belum terisi") Exit Sub End If
KB36109036.Text = "" UN36109036.Text = "" HR36109036.Text = "" End Sub
Private Sub Button336109036_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button336109036.Click If TextBox136109036.Text.Length = 0 Then MsgBox("no.transaksi belum terisi") Exit Sub End If
If TextBox236109036.Text.Length = 0 Then MsgBox("jenis transaksi belum terisi") Exit Sub End If
If browse.JumlanBaris > 0 Then MsgBox("NO.TRANS sudah ada") Exit Sub End If
If Data.Rows.Count = 0 Then MsgBox("data tidak tersedia") End If
Dim com As New OleDb.OleDbCommand com = New OleDb.OleDbCommand("insert into mastertransaksi (notrans, tanggaltransaksi, jenistransaksi) values ('" & TextBox136109036.Text & "',#" & DateTimePicker136109036.Value.Date & "#," & Val(TextBox236109036.Text) & ")", CONECT)
Public Class LATIHAN_035_36109056
BalasHapusDim CONECT As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\DATAMAJEMUK.accdb;Jet OLEDB:Database Password=2422")
Dim DT As New DataTable
Dim cari As New ByIskandar.CariKeDataBaseByIskandar
Private Sub LATIHAN035012_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim biya As New OleDb.OleDbDataAdapter
biya = New OleDb.OleDbDataAdapter("select KODEBARANG, UNIT, HARGA FROM DETAILTRANSAKSI WHERE NOTRANS= '" & KB_36109056.Text & "'", CONECT)
DT.Rows.Clear()
biya.Fill(DT)
DataGridView1.DataSource = DT
biya.Dispose()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If KB_36109056.Text.Length = 0 Then
MsgBox("kode barang belum terisi")
Exit Sub
End If
If Val(UN_36109056.Text) = 0 Then
MsgBox("UNIT belum terisi")
Exit Sub
End If
If Val(HR_36109056.Text) = 0 Then
MsgBox("HARGA belum terisi")
Exit Sub
End If
Dim bie As DataRow
bie = DT.NewRow
bie("KODEBARANG") = KB_36109056.Text
bie("UNIT") = UN_36109056.Text
bie("HARGA") = HR_36109056.Text
DT.Rows.Add(bie)
KB_36109056.Text = ""
UN_36109056.Text = ""
HR_36109056.Text = ""
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
If TextBox1_36109056.Text.Length = 0 Then
MsgBox("no.transaksi belum terisi")
Exit Sub
End If
If TextBox2_36109056.Text.Length = 0 Then
MsgBox("jenis transaksi belum terisi")
Exit Sub
End If
cari.AturPencarianDataBase("mastertransaksi", "notrans", TextBox1_36109056.Text, 1, CONECT)
If cari.JumlanBaris > 0 Then
MsgBox("NO.TRANS sudah ada")
Exit Sub
End If
If DT.Rows.Count = 0 Then
MsgBox("data tidak tersedia")
End If
Dim com As New OleDb.OleDbCommand
com = New OleDb.OleDbCommand("insert into mastertransaksi (notrans, tanggaltransaksi, jenistransaksi) values ('" & TextBox1_36109056.Text & "',#" & DateTimePicker1.Value.Date & "#," & Val(TextBox2_36109056.Text) & ")", CONECT)
CONECT.Open()
com.ExecuteNonQuery()
CONECT.Close()
For Each r As DataRow In DT.Rows
com = New OleDb.OleDbCommand("insert into detailtransaksi (notrans, kodebarang, unit, harga ) values ('" & TextBox1_36109056.Text & "','" & r("kodebarang") & "'," & r("unit") & "," & r("harga") & ")", CONECT)
CONECT.Open()
com.ExecuteNonQuery()
CONECT.Close()
com.Dispose()
Next
DT.Rows.Clear()
TextBox1_36109056.Text = ""
TextBox2_36109056.Text = ""
End Sub
End Class
Public Class LATIHAN03536109033
BalasHapusDim CONECT As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\DATAMAJEMUK.accdb;Jet OLEDB:Database Password=tahir")
Dim Data As New DataTable
Dim browse As New ByIskandar.CariKeDataBaseByIskandar
Private Sub LATIHAN03536109033_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim tiwi As New OleDb.OleDbDataAdapter
tiwi = New OleDb.OleDbDataAdapter("select KODEBARANG, UNIT, HARGA FROM DETAILTRANSAKSI WHERE NOTRANS= '" & KB36109033.Text & "'", CONECT)
Data.Rows.Clear()
tiwi.Fill(Data)
DataGridView1.DataSource = Data
tiwi.Dispose()
End Sub
Private Sub Button136109033_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button136109033.Click
If KB36109033.Text.Length = 0 Then
MsgBox("kode barang belum terisi")
Exit Sub
End If
If Val(UN36109033.Text) = 0 Then
MsgBox("UNIT belum terisi")
Exit Sub
End If
If Val(HR36109033.Text) = 0 Then
MsgBox("HARGA belum terisi")
Exit Sub
End If
Dim pratiwi As DataRow
pratiwi = Data.NewRow
pratiwi("KODEBARANG") = KB36109033.Text
pratiwi("UNIT") = UN36109033.Text
pratiwi("HARGA") = HR36109033.Text
Data.Rows.Add(pratiwi)
KB36109033.Text = ""
UN36109033.Text = ""
HR36109033.Text = ""
End Sub
Private Sub Button336109033_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button336109033.Click
If TextBox136109033.Text.Length = 0 Then
MsgBox("no.transaksi belum terisi")
Exit Sub
End If
If TextBox236109033.Text.Length = 0 Then
MsgBox("jenis transaksi belum terisi")
Exit Sub
End If
browse.AturPencarianDataBase("mastertransaksi", "notrans", TextBox136109033.Text, 1, CONECT)
If browse.JumlanBaris > 0 Then
MsgBox("NO.TRANS sudah ada")
Exit Sub
End If
If Data.Rows.Count = 0 Then
MsgBox("data tidak tersedia")
End If
Dim com As New OleDb.OleDbCommand
com = New OleDb.OleDbCommand("insert into mastertransaksi (notrans, tanggaltransaksi, jenistransaksi) values ('" & TextBox136109033.Text & "',#" & DateTimePicker136109033.Value.Date & "#," & Val(TextBox236109033.Text) & ")", CONECT)
CONECT.Open()
com.ExecuteNonQuery()
CONECT.Close()
For Each t As DataRow In Data.Rows
com = New OleDb.OleDbCommand("insert into detailtransaksi (notrans, kodebarang, unit, harga ) values ('" & TextBox136109033.Text & "','" & t("kodebarang") & "'," & t("unit") & "," & t("harga") & ")", CONECT)
CONECT.Open()
com.ExecuteNonQuery()
CONECT.Close()
com.Dispose()
Next
Data.Rows.Clear()
TextBox136109033.Text = ""
TextBox236109033.Text = ""
End Sub
End Class
Public Class LATIHAN35035
BalasHapusDim Jalan As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source =" & Application.StartupPath & "\Datamajemuk.ACCDB")
Dim gitik As New DataTable
Private Sub Latihan35_083_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'mendeklarasikan kendaraan
Dim bojel As New OleDb.OleDbDataAdapter
'Mengatur data yang akan di angkut
bojel = New OleDb.OleDbDataAdapter("SELECT kodebarang,unit,harga FROM DETAILTRANSAKSI where notrans='" & TextBox1035.Text & "'", Jalan)
'bersihkan data
gitik.Rows.Clear()
'untuk memasukkan data yg telah di angkut ke dalam datatable
bojel.Fill(gitik)
'untuk menampilkan isi datatable ke data grid view
bojel.Dispose()
DataGridView1035.DataSource = gitik
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1035.Click
'Memeriksa isi textbox
If KB035.Text.Length = 0 Then
MsgBox("Please, insert the code of goods")
Exit Sub
End If
If UN035.Text.Length = 0 Then
MsgBox("Please, insert the unit of goods")
Exit Sub
End If
If HR035.Text.Length = 0 Then
MsgBox("Please, insert the cost of goods")
Exit Sub
End If
'penyimpanan data ke datatable
gitik.Rows.Add((KB035.Text), Val(UN035.Text), Val(HR035.Text))
'mengosongkan textbox
KB035.Text = ""
UN035.Text = ""
HR035.Text = ""
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3035.Click
BalasHapus'Memeriksa isi textbox
If TextBox1035.Text.Length = 0 Then
MsgBox("Please, insert the Number of the transaction")
Exit Sub
End If
If TextBox2035.Text.Length = 0 Then
MsgBox("Please, insert the type of the transaction")
Exit Sub
End If
If gitik.Rows.Count = 0 Then
MsgBox("the data is none")
Exit Sub
End If
'Memeriksa nomor transaksi pd master transaksi
Dim search As New ByIskandar.CariKeDataBaseByIskandar
search.AturPencarianDataBase("mastertransaksi", "notrans", TextBox1035.Text, 1, Jalan)
If search.JumlanBaris > 0 Then
MsgBox("the code has been exist")
Exit Sub
End If
'Proses Penyimpanan ke tabel master transaksi
Dim kacci As New OleDb.OleDbCommand
kacci = New OleDb.OleDbCommand("insert into mastertransaksi (notrans,tanggaltransaksi,jenistransaksi) values ('" & TextBox1035.Text & "',#" & DateTimePicker1035.Value.Month & "/" & DateTimePicker1035.Value.Day & "/" & DateTimePicker1035.Value.Year & "#,'" & TextBox2035.Text & "')", Jalan)
Jalan.Open()
kacci.ExecuteNonQuery()
Jalan.Close()
'penyimpanan isi datatable ke detail transaksi
For Each nhana As DataRow In gitik.Rows
kacci = New OleDb.OleDbCommand("insert into detailtransaksi (notrans,kodebarang,unit,harga) values ('" & TextBox1035.Text & "','" & nhana("kodebarang") & "'," & nhana("unit") & "," & nhana("harga") & ")", Jalan)
Jalan.Open()
kacci.ExecuteNonQuery()
Jalan.Close()
Next
kacci.Dispose()
'Mengosongkan isi text box
TextBox1035.Text = ""
TextBox2035.Text = ""
'Mengosongkan baris datatable
gitik.Rows.Clear()
'menutup form
Me.Close()
End Sub
End Class
Public Class Form3536109040
BalasHapusDim CONECT As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\DATAMAJEMUK.accdb;Jet OLEDB:Database Password=150991")
Dim DT As New DataTable
Dim cari As New ByIskandar.CariKeDataBaseByIskandar
Private Sub LATIHAN035012_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim mita As New OleDb.OleDbDataAdapter
biya = New OleDb.OleDbDataAdapter("select KODEBARANG, UNIT, HARGA FROM DETAILTRANSAKSI WHERE NOTRANS= '" & KB_36109040.Text & "'", CONECT)
DT.Rows.Clear()
mita.Fill(DT)
DataGridView1.DataSource = DT
mita.Dispose()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If KB_36109040.Text.Length = 0 Then
MsgBox("kode barang belum terisi")
Exit Sub
End If
If Val(UN_36109040.Text) = 0 Then
MsgBox("UNIT belum terisi")
Exit Sub
End If
If Val(HR_36109040.Text) = 0 Then
MsgBox("HARGA belum terisi")
Exit Sub
End If
Dim mieta As DataRow
mieta = DT.NewRow
mieta("KODEBARANG") = KB_36109040.Text
mieta("UNIT") = UN_36109040.Text
mieta("HARGA") = HR_36109040.Text
DT.Rows.Add(mieta)
KB_36109040.Text = ""
UN_36109040.Text = ""
HR_36109040.Text = ""
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
If TextBox1_36109040.Text.Length = 0 Then
MsgBox("no.transaksi belum terisi")
Exit Sub
End If
If TextBox2_36109040.Text.Length = 0 Then
MsgBox("jenis transaksi belum terisi")
Exit Sub
End If
cari.AturPencarianDataBase("mastertransaksi", "notrans", TextBox1_36109040.Text, 1, CONECT)
If cari.JumlanBaris > 0 Then
MsgBox("NO.TRANS sudah ada")
Exit Sub
End If
If DT.Rows.Count = 0 Then
MsgBox("data tidak tersedia")
End If
Dim com As New OleDb.OleDbCommand
com = New OleDb.OleDbCommand("insert into mastertransaksi (notrans, tanggaltransaksi, jenistransaksi) values ('" & TextBox1_36109040.Text & "',#" & DateTimePicker1.Value.Date & "#," & Val(TextBox2_36109040.Text) & ")", CONECT)
CONECT.Open()
com.ExecuteNonQuery()
CONECT.Close()
For Each r As DataRow In DT.Rows
com = New OleDb.OleDbCommand("insert into detailtransaksi (notrans, kodebarang, unit, harga ) values ('" & TextBox1_36109040.Text & "','" & r("kodebarang") & "'," & r("unit") & "," & r("harga") & ")", CONECT)
CONECT.Open()
com.ExecuteNonQuery()
CONECT.Close()
com.Dispose()
Next
DT.Rows.Clear()
TextBox1_36109040.Text = ""
TextBox2_36109040.Text = ""
End Sub
End Class
Public Class LATIHAN035_36109049
BalasHapus'DEKLARASI CONECTION
Dim CONECT As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\DATAMAJEMUK.accdb;Jet OLEDB:Database Password=wirda")
'deklarasi data tabel
Dim wirda As New DataTable
Dim wirdapaulus As New ByIskandar.CariKeDataBaseByIskandar
Private Sub LATIHAN035_36109049_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'deklarasi adapter
Dim poltek As New OleDb.OleDbDataAdapter
poltek = New OleDb.OleDbDataAdapter("select KODEBARANG, UNIT, HARGA FROM DETAILTRANSAKSI WHERE NOTRANS= '" & KB_36109049.Text & "'", CONECT) 'memunculkan semua data dari tabel barang dlm acces
wirda.Rows.Clear() 'membersihkan data table
poltek.Fill(wirda) 'mengisi database ke dlm data table
DataGridView1.DataSource = wirda 'memunculkan dlm datagridview
poltek.Dispose() 'menghancurkan kendaraan (adapter) yg sdh dipake
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'untuk mencari jgn sampai data yg akan dimasukkan tidak lengkap
If KB_36109049.Text.Length = 0 Then 'untuk pencarian yang bersifat angka
MsgBox("kode barang belum terisi")
Exit Sub 'jgn lanjut ke proses berikutnya
End If
If Val(UN_36109049.Text) = 0 Then 'untuk pencarian yang bersifat angka
MsgBox("UNIT belum terisi")
Exit Sub 'jgn lanjut ke proses berikutnya
End If
If Val(HR_36109049.Text) = 0 Then 'untuk pencarian yang bersifat angka
MsgBox("HARGA belum terisi")
Exit Sub 'jgn lanjut ke proses berikutnya
End If
'UNTUK MENYMPAN DATA YG DIMASUKKAN KE DALAM DATAGRIDVIEW
Dim apkom As DataRow
apkom = wirda.NewRow ' menambah baris
apkom("KODEBARANG") = KB_36109049.Text
apkom("UNIT") = UN_36109049.Text
apkom("HARGA") = HR_36109049.Text
wirda.Rows.Add(apkom)
KB_36109049.Text = ""
UN_36109049.Text = ""
HR_36109049.Text = ""
End Sub
Lanjutan 35
BalasHapusPrivate Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
'untuk mencari jgn sampai data yg akan dimasukkan tidak lengkap
If TextBox1_36109049.Text.Length = 0 Then 'untuk pencarian yang bersifat angka
MsgBox("no.transaksi belum terisi")
Exit Sub 'jgn lanjut ke proses berikutnya
End If
If TextBox2_36109049.Text.Length = 0 Then 'untuk pencarian yang bersifat angka
MsgBox("jenis transaksi belum terisi")
Exit Sub 'jgn lanjut ke proses berikutnya
End If
'untuk mencari jgn sampai data yg akan dimasukkan sudah ada
wirdapaulus.AturPencarianDataBase("mastertransaksi", "notrans", TextBox1_36109049.Text, 1, CONECT)
If wirdapaulus.JumlanBaris > 0 Then
MsgBox("NO.TRANS sudah ada")
Exit Sub
End If
If wirda.Rows.Count = 0 Then
MsgBox("data tidak tersedia")
End If
'untuk memasukkan data dari visual basc ke dlm acces
Dim com As New OleDb.OleDbCommand
com = New OleDb.OleDbCommand("insert into mastertransaksi (notrans, tanggaltransaksi, jenistransaksi) values ('" & TextBox1_36109049.Text & "',#" & DateTimePicker1.Value.Date & "#," & Val(TextBox2_36109049.Text) & ")", CONECT)
CONECT.Open()
com.ExecuteNonQuery()
CONECT.Close()
For Each r As DataRow In wirda.Rows
com = New OleDb.OleDbCommand("insert into detailtransaksi (notrans, kodebarang, unit, harga ) values ('" & TextBox1_36109049.Text & "','" & r("kodebarang") & "'," & r("unit") & "," & r("harga") & ")", CONECT)
CONECT.Open()
com.ExecuteNonQuery()
CONECT.Close()
com.Dispose()
Next
wirda.Rows.Clear()
TextBox1_36109049.Text = ""
TextBox2_36109049.Text = ""
End Sub
End Class
Public Class LATIHAN03536109038
BalasHapusDim CONECT As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\DATAMAJEMUK.accdb;Jet OLEDB:Database Password=icha")
Dim DT As New DataTable
Dim cari As New ByIskandar.CariKeDataBaseByIskandar
Private Sub LATIHAN03536109038_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim Azizah As New OleDb.OleDbDataAdapter
Azizah = New OleDb.OleDbDataAdapter("select KODEBARANG, UNIT, HARGA FROM DETAILTRANSAKSI WHERE NOTRANS= '" & KB36109038.Text & "'", CONECT)
DT.Rows.Clear()
Azizah.Fill(DT)
DataGridView136109038.DataSource = DT
Azizah.Dispose()
End Sub
Private Sub Button136109038_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button136109038.Click
If KB36109038.Text.Length = 0 Then
MsgBox("kode barang belum terisi")
Exit Sub
End If
If Val(UN36109038.Text) = 0 Then
MsgBox("UNIT belum terisi")
Exit Sub
End If
If Val(HR36109038.Text) = 0 Then
MsgBox("HARGA belum terisi")
Exit Sub
End If
Dim Reza As DataRow
Reza = DT.NewRow
Reza("KODEBARANG") = KB36109038.Text
Reza("UNIT") = UN36109038.Text
Reza("HARGA") = HR36109038.Text
DT.Rows.Add(Reza)
KB36109038.Text = ""
UN36109038.Text = ""
HR36109038.Text = ""
End Sub
Private Sub Button336109038_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button336109038.Click
If TextBox136109038.Text.Length = 0 Then
MsgBox("no.transaksi belum terisi")
Exit Sub
End If
If TextBox236109038.Text.Length = 0 Then
MsgBox("jenis transaksi belum terisi")
Exit Sub
End If
cari.AturPencarianDataBase("mastertransaksi", "notrans", TextBox136109038.Text, 1, CONECT)
If cari.JumlanBaris > 0 Then
MsgBox("NO.TRANS sudah ada")
Exit Sub
End If
If DT.Rows.Count = 0 Then
MsgBox("data tidak tersedia")
End If
Dim com As New OleDb.OleDbCommand
com = New OleDb.OleDbCommand("insert into mastertransaksi (notrans, tanggaltransaksi, jenistransaksi) values ('" & TextBox136109038.Text & "',#" & DateTimePicker136109038.Value.Date & "#," & Val(TextBox236109038.Text) & ")", CONECT)
CONECT.Open()
com.ExecuteNonQuery()
CONECT.Close()
For Each r As DataRow In DT.Rows
com = New OleDb.OleDbCommand("insert into detailtransaksi (notrans, kodebarang, unit, harga ) values ('" & TextBox136109038.Text & "','" & r("kodebarang") & "'," & r("unit") & "," & r("harga") & ")", CONECT)
CONECT.Open()
com.ExecuteNonQuery()
CONECT.Close()
com.Dispose()
Next
DT.Rows.Clear()
TextBox136109038.Text = ""
TextBox236109038.Text = ""
End Sub
End Class
Public Class LATIHAN03536109032
BalasHapusDim sambung As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\DATAMAJEMUK.accdb;Jet OLEDB:Database Password=jayapura")
Dim toshiba As New DataTable
Dim nokia As New ByIskandar.CariKeDataBaseByIskandar
Private Sub LATIHAN03536109032_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim laptop As New OleDb.OleDbDataAdapter
laptop = New OleDb.OleDbDataAdapter("select KODEBARANG, UNIT, HARGA FROM DETAILTRANSAKSI WHERE NOTRANS= '" & KB.Text & "'", sambung)
toshiba.Rows.Clear()
laptop.Fill(toshiba)
DataGridView1.DataSource = toshiba
laptop.Dispose()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If KB.Text.Length = 0 Then
MsgBox("kode barang belum terisi")
Exit Sub
End If
If Val(UN.Text) = 0 Then
MsgBox("UNIT belum terisi")
Exit Sub
End If
If Val(HR.Text) = 0 Then
MsgBox("HARGA belum terisi")
Exit Sub
End If
Dim key As DataRow
key = toshiba.NewRow
key("KODEBARANG") = KB.Text
key("UNIT") = UN.Text
key("HARGA") = HR.Text
toshiba.Rows.Add(key)
KB.Text = ""
UN.Text = ""
HR.Text = ""
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
If TextBox1.Text.Length = 0 Then
MsgBox("no.transaksi belum terisi")
Exit Sub
End If
If TextBox2.Text.Length = 0 Then
MsgBox("jenis transaksi belum terisi")
Exit Sub
End If
nokia.AturPencarianDataBase("mastertransaksi", "notrans", TextBox1.Text, 1, sambung)
If nokia.JumlanBaris > 0 Then
MsgBox("NO.TRANS sudah ada")
Exit Sub
End If
If toshiba.Rows.Count = 0 Then
MsgBox("data tidak tersedia")
End If
Dim com As New OleDb.OleDbCommand
com = New OleDb.OleDbCommand("insert into mastertransaksi (notrans, tanggaltransaksi, jenistransaksi) values ('" & TextBox1.Text & "',#" & DateTimePicker1.Value.Date & "#," & Val(TextBox2.Text) & ")", sambung)
sambung.Open()
com.ExecuteNonQuery()
sambung.Close()
For Each r As DataRow In toshiba.Rows
com = New OleDb.OleDbCommand("insert into detailtransaksi (notrans, kodebarang, unit, harga ) values ('" & TextBox1.Text & "','" & r("kodebarang") & "'," & r("unit") & "," & r("harga") & ")", sambung)
sambung.Open()
com.ExecuteNonQuery()
sambung.Close()
com.Dispose()
Next
toshiba.Rows.Clear()
TextBox1.Text = ""
TextBox2.Text = ""
End Sub
End Class
Public Class LATIHAN035041
BalasHapusDim CONECT As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\DATAMAJEMUK.accdb; Jet OLEDB:Database Password=12")
Dim DT As New DataTable
Dim cari As New ByIskandar.CariKeDataBaseByIskandar
Private Sub LATIHAN035012_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim nisa As New OleDb.OleDbDataAdapter
nisa = New OleDb.OleDbDataAdapter("select KODEBARANG, UNIT, HARGA FROM DETAILTRANSAKSI WHERE NOTRANS= '" & KB36109041.Text & "'", CONECT)
nisa.Fill(DT)
DataGridView1.DataSource = DT
nisa.Dispose()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If KB36109041.Text.Length = 0 Then
MsgBox("kode barang belum terisi")
Exit Sub
End If
If Val(UN36109041.Text) = 0 Then
MsgBox("UNIT belum terisi")
Exit Sub
End If
If Val(HR36109041.Text) = 0 Then
MsgBox("HARGA belum terisi")
Exit Sub
Dim drzany As DataRow
drzany = DT.NewRow
drzany("KODEBARANG") = KB36109041.Text
drzany("UNIT") = UN36109041.Text
drzany("HARGA") = HR36109041.Text
DT.Rows.Add(drzany)
KB36109041.Text = ""
UN36109041.Text = ""
HR36109041.Text = ""
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
If TextBox136109041.Text.Length = 0 Then
MsgBox("no.transaksi belum terisi")
Exit Sub
End If
If TextBox236109041.Text.Length = 0 Then
MsgBox("jenis transaksi belum terisi")
Exit Sub
End If
cari.AturPencarianDataBase("mastertransaksi", "notrans", TextBox136109041.Text, 1, CONECT)
If cari.JumlanBaris > 0 Then
MsgBox("NO.TRANS sudah ada")
Exit Sub
End If
If DT.Rows.Count = 0 Then
MsgBox("data tidak tersedia")
End If
Dim com As New OleDb.OleDbCommand
com = New OleDb.OleDbCommand("insert into mastertransaksi (notrans, tanggaltransaksi, jenistransaksi) values ('" & TextBox136109041.Text & "',#" & DateTimePicker1.Value.Date & "#,'" & TextBox236109041.Text & "')", CONECT)
CONECT.Open()
com.ExecuteNonQuery()
CONECT.Close()
For Each r As DataRow In DT.Rows
com = New OleDb.OleDbCommand("insert into detailtransaksi (notrans, kodebarang, unit, harga ) values ('" & TextBox136109041.Text & "','" & r("kodebarang") & "'," & r("unit") & "," & r("harga") & ")", CONECT)
CONECT.Open()
com.ExecuteNonQuery()
CONECT.Close()
com.Dispose()
Next
DT.Rows.Clear()
TextBox136109041.Text = ""
TextBox236109041.Text = ""
End Sub
End Class
Public Class LATIHAN_03536109055
BalasHapusDim CONECT As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\DATAMAJEMUK.accdb;Jet OLEDB:Database Password=2312")
Dim DT As New DataTable
Dim cari As New ByIskandar.CariKeDataBaseByIskandar
Private Sub LATIHAN_03536109055_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim biya As New OleDb.OleDbDataAdapter
biya = New OleDb.OleDbDataAdapter("select KODEBARANG, UNIT, HARGA FROM DETAILTRANSAKSI WHERE NOTRANS= '" & KB36109055.Text & "'", CONECT)
DT.Rows.Clear()
falah.Fill(DT)
DataGridView136109055.DataSource = DT
falah.Dispose()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If KB36109055.Text.Length = 0 Then
MsgBox("kode barang belum terisi")
Exit Sub
End If
If Val(UN36109055.Text) = 0 Then
MsgBox("UNIT belum terisi")
Exit Sub
End If
If Val(HR36109055.Text) = 0 Then
MsgBox("HARGA belum terisi")
Exit Sub
End If
Dim dr As DataRow
dr = DT.NewRow
dr("KODEBARANG") = KB36109055.Text
dr("UNIT") = UN36109055.Text
dr("HARGA") = HR36109055.Text
DT.Rows.Add(dr)
KB36109055.Text = ""
UN36109055.Text = ""
HR36109055.Text = ""
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
If TextBox136109055.Text.Length = 0 Then
MsgBox("no.transaksi belum terisi")
Exit Sub
End If
If TextBox236109055.Text.Length = 0 Then
MsgBox("jenis transaksi belum terisi")
Exit Sub
End If
cari.AturPencarianDataBase("mastertransaksi", "notrans", TextBox136109055.Text, 1, CONECT)
If cari.JumlanBaris > 0 Then
MsgBox("NO.TRANS sudah ada")
Exit Sub
End If
If DT.Rows.Count = 0 Then
MsgBox("data tidak tersedia")
End If
Dim com As New OleDb.OleDbCommand
com = New OleDb.OleDbCommand("insert into mastertransaksi (notrans, tanggaltransaksi, jenistransaksi) values ('" & TextBox136109055.Text & "',#" & DateTimePicker1.Value.Date & "#," & Val(TextBox236109055.Text) & ")", CONECT)
CONECT.Open()
com.ExecuteNonQuery()
CONECT.Close()
For Each r As DataRow In DT.Rows
com = New OleDb.OleDbCommand("insert into detailtransaksi (notrans, kodebarang, unit, harga ) values ('" & TextBox1_36109056.Text & "','" & r("kodebarang") & "'," & r("unit") & "," & r("harga") & ")", CONECT)
CONECT.Open()
com.ExecuteNonQuery()
CONECT.Close()
com.Dispose()
Next
DT.Rows.Clear()
TextBox136109055.Text = ""
TextBox236109055.Text = ""
End Sub
End Class
Part 1
BalasHapusPublic Class LATIHAN03536109054
'DEKLARASI CONECTION
Dim CONECT As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= D:\berbagi\LATIHAN 35-40 DATA MAJEMUK\DataMajemuk.accdb;Jet OLEDB:Database Password=salam")
'deklarasi data tabel
Dim DT As New DataTable
Dim cari As New ByIskandar.CariKeDataBaseByIskandar
Private Sub LATIHAN035012_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'deklarasi adapter
Dim wawan As New OleDb.OleDbDataAdapter
wawan = New OleDb.OleDbDataAdapter("select KODEBARANG, UNIT, HARGA FROM DETAILTRANSAKSI WHERE NOTRANS= '" & KB36109054.Text & "'", CONECT) 'memunculkan semua data dari tabel barang dlm acces
DT.Rows.Clear() 'membersihkan data table
wawan.Fill(DT) 'mengisi database ke dlm data table
DGV136109054.DataSource = DT 'memunculkan dlm datagridview
wawan.Dispose() 'menghancurkan kendaraan (adapter) yg sdh dipake
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button136109054.Click
'untuk mencari jgn sampai data yg akan dimasukkan tidak lengkap
If KB36109054.Text.Length = 0 Then 'untuk pencarian yang bersifat angka
MsgBox("kode barang belum terisi")
Exit Sub 'jgn lanjut ke proses berikutnya
End If
If Val(UN36109054.Text) = 0 Then 'untuk pencarian yang bersifat angka
MsgBox("UNIT belum terisi")
Exit Sub 'jgn lanjut ke proses berikutnya
End If
If Val(HR36109054.Text) = 0 Then 'untuk pencarian yang bersifat angka
MsgBox("HARGA belum terisi")
Exit Sub 'jgn lanjut ke proses berikutnya
End If
'UNTUK MENYMPAN DATA YG DIMASUKKAN KE DALAM DATAGRIDVIEW
Dim drzany As DataRow
drzany = DT.NewRow ' menambah baris
drzany("KODEBARANG") = KB36109054.Text
drzany("UNIT") = UN36109054.Text
drzany("HARGA") = HR36109054.Text
DT.Rows.Add(drzany)
KB36109054.Text = ""
UN36109054.Text = ""
HR36109054.Text = ""
End Sub
Part 2
BalasHapusPrivate Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button336109054.Click
'untuk mencari jgn sampai data yg akan dimasukkan tidak lengkap
If TextBox136109054.Text.Length = 0 Then 'untuk pencarian yang bersifat angka
MsgBox("no.transaksi belum terisi")
Exit Sub 'jgn lanjut ke proses berikutnya
End If
If TextBox236109054.Text.Length = 0 Then 'untuk pencarian yang bersifat angka
MsgBox("jenis transaksi belum terisi")
Exit Sub 'jgn lanjut ke proses berikutnya
End If
'untuk mencari jgn sampai data yg akan dimasukkan sudah ada
cari.AturPencarianDataBase("mastertransaksi", "notrans", TextBox136109054.Text, 1, CONECT)
If cari.JumlanBaris > 0 Then
MsgBox("NO.TRANS sudah ada")
Exit Sub
End If
If DT.Rows.Count = 0 Then
MsgBox("data tidak tersedia")
End If
'untuk memasukkan data dari visual basc ke dlm acces
Dim com As New OleDb.OleDbCommand
com = New OleDb.OleDbCommand("insert into mastertransaksi (notrans, tanggaltransaksi, jenistransaksi) values ('" & TextBox136109054.Text & "',#" & DTP136109054.Value.Date & "#,'" & TextBox236109054.Text & "')", CONECT)
CONECT.Open()
com.ExecuteNonQuery()
CONECT.Close()
For Each r As DataRow In DT.Rows
com = New OleDb.OleDbCommand("insert into detailtransaksi (notrans, kodebarang, unit, harga ) values ('" & TextBox136109054.Text & "','" & r("kodebarang") & "'," & r("unit") & "," & r("harga") & ")", CONECT)
CONECT.Open()
com.ExecuteNonQuery()
CONECT.Close()
com.Dispose()
Next
DT.Rows.Clear()
TextBox136109054.Text = ""
TextBox236109054.Text = ""
End Sub
End Class
Public Class Form3536109050
BalasHapusDim CONECT As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\DATAMAJEMUK.accdb;Jet OLEDB:Database Password=nideria")
Dim data As New DataTable
Dim cari As New ByIskandar.CariKeDataBaseByIskandar
Private Sub Form3536109050_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim adapt As New OleDb.OleDbDataAdapter
adapt = New OleDb.OleDbDataAdapter("select KODEBARANG, UNIT, HARGA FROM DETAILTRANSAKSI WHERE NOTRANS= '" & KB.Text & "'", CONECT)
data.Rows.Clear()
adapt.Fill(data)
DataGridView1.DataSource = data
adapt.Dispose()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If KB.Text.Length = 0 Then
MsgBox("kode barang belum terisi")
Exit Sub
End If
If Val(UN.Text) = 0 Then
MsgBox("UNIT belum terisi")
Exit Sub
End If
If Val(HR.Text) = 0 Then
MsgBox("HARGA belum terisi")
Exit Sub
End If
Dim simpan As DataRow
simpan = data.NewRow
simpan("KODEBARANG") = KB.Text
simpan("UNIT") = UN.Text
simpan("HARGA") = HR.Text
data.Rows.Add(simpan)
KB.Text = ""
UN.Text = ""
HR.Text = ""
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
BalasHapusIf TextBox1.Text.Length = 0 Then
MsgBox("no.transaksi belum terisi")
Exit Sub
End If
If TextBox2.Text.Length = 0 Then
MsgBox("jenis transaksi belum terisi")
Exit Sub
End If
cari.AturPencarianDataBase("mastertransaksi", "notrans", TextBox1.Text, 1, CONECT)
If cari.JumlanBaris > 0 Then
MsgBox("NO.TRANS sudah ada")
Exit Sub
End If
If data.Rows.Count = 0 Then
MsgBox("data tidak tersedia")
End If
Dim com As New OleDb.OleDbCommand
com = New OleDb.OleDbCommand("insert into mastertransaksi (notrans, tanggaltransaksi, jenistransaksi) values ('" & TextBox1.Text & "',#" & DateTimePicker1.Value.Date & "#," & Val(TextBox2.Text) & ")", CONECT)
CONECT.Open()
com.ExecuteNonQuery()
CONECT.Close()
For Each r As DataRow In data.Rows
com = New OleDb.OleDbCommand("insert into detailtransaksi (notrans, kodebarang, unit, harga ) values ('" & TextBox1.Text & "','" & r("kodebarang") & "'," & r("unit") & "," & r("harga") & ")", CONECT)
CONECT.Open()
com.ExecuteNonQuery()
CONECT.Close()
com.Dispose()
Next
data.Rows.Clear()
TextBox1.Text = ""
TextBox2.Text = ""
End Sub
End Class
Public Class LATIHAN03536109029
BalasHapus'DEKLARASI CONECTION
Dim CONNECT As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\DATAMAJEMUK.accdb;jet oledb:database password = hapsari")
'deklarasi data tabel
Dim DT As New DataTable
Dim cari As New ByIskandar.CariKeDataBaseByIskandar
Private Sub LATIHAN03536109029_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'deklarasi adapter
Dim cute As New OleDb.OleDbDataAdapter
cute = New OleDb.OleDbDataAdapter("select KODEBARANG, UNIT, HARGA FROM DETAILTRANSAKSI WHERE NOTRANS= '" & KB36109029.Text & "'", CONNECT) 'memunculkan semua data dari tabel barang dlm acces
DT.Rows.Clear() 'membersihkan data table
cute.Fill(DT) 'mengisi database ke dlm data table
DataGridView1.DataSource = DT 'memunculkan dlm datagridview
cute.Dispose() 'menghancurkan kendaraan (adapter) yg sdh dipake
End Sub
Private Sub Button136109029_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button136109029.Click
'untuk mencari jgn sampai data yg akan dimasukkan tidak lengkap
If KB36109029.Text.Length = 0 Then 'untuk pencarian yang bersifat angka
MsgBox("kode barang belum terisi")
Exit Sub 'jgn lanjut ke proses berikutnya
End If
If Val(UN36109029.Text) = 0 Then 'untuk pencarian yang bersifat angka
MsgBox("UNIT belum terisi")
Exit Sub 'jgn lanjut ke proses berikutnya
End If
If Val(HR36109029.Text) = 0 Then 'untuk pencarian yang bersifat angka
MsgBox("HARGA belum terisi")
Exit Sub 'jgn lanjut ke proses berikutnya
End If
'UNTUK MENYMPAN DATA YG DIMASUKKAN KE DALAM DATAGRIDVIEW
Dim indah As DataRow
indah = DT.NewRow ' menambah baris
indah("KODEBARANG") = KB36109029.Text
indah("UNIT") = UN36109029.Text
indah("HARGA") = HR36109029.Text
DT.Rows.Add(indah)
KB36109029.Text = ""
UN36109029.Text = ""
HR36109029.Text = ""
End Sub
Private Sub Button236109029_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button236109029.Click
BalasHapus'untuk mencari jgn sampai data yg akan dimasukkan tidak lengkap
If TextBox136109029.Text.Length = 0 Then 'untuk pencarian yang bersifat angka
MsgBox("no.transaksi belum terisi")
Exit Sub 'jgn lanjut ke proses berikutnya
End If
If TextBox236109029.Text.Length = 0 Then 'untuk pencarian yang bersifat angka
MsgBox("jenis transaksi belum terisi")
Exit Sub 'jgn lanjut ke proses berikutnya
End If
'untuk mencari jgn sampai data yg akan dimasukkan sudah ada
cari.AturPencarianDataBase("mastertransaksi", "notrans", TextBox136109029.Text, 1, CONNECT)
If cari.JumlanBaris > 0 Then
MsgBox("NO.TRANS sudah ada")
Exit Sub
End If
If DT.Rows.Count = 0 Then
MsgBox("data tidak tersedia")
End If
'untuk memasukkan data dari visual basc ke dlm acces
Dim com As New OleDb.OleDbCommand
com = New OleDb.OleDbCommand("insert into mastertransaksi (notrans, tanggaltransaksi, jenistransaksi) values ('" & TextBox136109029.Text & "',#" & DateTimePicker1.Value.Date & "#," & Val(TextBox236109029.Text) & ")", CONNECT)
CONNECT.Open()
com.ExecuteNonQuery()
CONNECT.Close()
For Each r As DataRow In DT.Rows
com = New OleDb.OleDbCommand("insert into detailtransaksi (notrans, kodebarang, unit, harga ) values ('" & TextBox136109029.Text & "','" & r("kodebarang") & "'," & r("unit") & "," & r("harga") & ")", CONNECT)
CONNECT.Open()
com.ExecuteNonQuery()
CONNECT.Close()
com.Dispose()
Next
DT.Rows.Clear()
TextBox136109029.Text = ""
TextBox236109029.Text = ""
End Sub
End Class
Public Class LATIHAN03536109036
BalasHapusDim CONECT As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\DATAMAJEMUK.accdb;Jet OLEDB:Database Password=100191")
Dim Data As New DataTable
Dim browse As New ByIskandar.CariKeDataBaseByIskandar
Private Sub LATIHAN03536109036_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim ibnu As New OleDb.OleDbDataAdapter
ibnu = New OleDb.OleDbDataAdapter("select KODEBARANG, UNIT, HARGA FROM DETAILTRANSAKSI WHERE NOTRANS= '" & KB36109036.Text & "'", CONECT)
Data.Rows.Clear()
ibnu.Fill(Data)
DataGridView1.DataSource = Data
ibnu.Dispose()
End Sub
Private Sub Button136109036_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button136109036.Click
If KB36109036.Text.Length = 0 Then
MsgBox("kode barang belum terisi")
Exit Sub
End If
If Val(UN36109036.Text) = 0 Then
MsgBox("UNIT belum terisi")
Exit Sub
End If
If Val(HR36109036.Text) = 0 Then
MsgBox("HARGA belum terisi")
Exit Sub
End If
Dim ibnu As DataRow
ibnu = Data.NewRow
ibnu("KODEBARANG") = KB36109036.Text
ibnu("UNIT") = UN36109036.Text
ibnu("HARGA") = HR36109036.Text
Data.Rows.Add(ibnu)
KB36109036.Text = ""
UN36109036.Text = ""
HR36109036.Text = ""
End Sub
Private Sub Button336109036_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button336109036.Click
If TextBox136109036.Text.Length = 0 Then
MsgBox("no.transaksi belum terisi")
Exit Sub
End If
If TextBox236109036.Text.Length = 0 Then
MsgBox("jenis transaksi belum terisi")
Exit Sub
End If
browse.AturPencarianDataBase("mastertransaksi", "notrans", TextBox136109036.Text, 1, CONECT)
If browse.JumlanBaris > 0 Then
MsgBox("NO.TRANS sudah ada")
Exit Sub
End If
If Data.Rows.Count = 0 Then
MsgBox("data tidak tersedia")
End If
Dim com As New OleDb.OleDbCommand
com = New OleDb.OleDbCommand("insert into mastertransaksi (notrans, tanggaltransaksi, jenistransaksi) values ('" & TextBox136109036.Text & "',#" & DateTimePicker136109036.Value.Date & "#," & Val(TextBox236109036.Text) & ")", CONECT)
CONECT.Open()
com.ExecuteNonQuery()
CONECT.Close()
For Each t As DataRow In Data.Rows
com = New OleDb.OleDbCommand("insert into detailtransaksi (notrans, kodebarang, unit, harga ) values ('" & TextBox136109036.Text & "','" & t("kodebarang") & "'," & t("unit") & "," & t("harga") & ")", CONECT)
CONECT.Open()
com.ExecuteNonQuery()
CONECT.Close()
com.Dispose()
Next
Data.Rows.Clear()
TextBox136109036.Text = ""
TextBox236109036.Text = ""
End Sub
End Class
http://hilariusmariotonapa.blogspot.com/2012/10/prosedur-penyelesaian-latihan3536110048.html
BalasHapushttp://hilariusmariotonapa.blogspot.com/2012/10/deskripsi-latihan3536110048.html
http://tiya-sri.blogspot.com/2012/10/latihan3536110044-aplikasi-komputer-4.html
BalasHapushttp://eminaomi.blogspot.com/2012/10/latihan3536110049.html
BalasHapushttp://nurrahmahrasyid2.blogspot.com/2012/10/latihan3536110042.html
BalasHapushttp://ias-anakbola.blogspot.com/2012/10/latihan3536110056_26.html
BalasHapushttp://03melisa.blogspot.com/2012/10/latihan-35-36110051-apkom-4-d3b.html
BalasHapushttp://sukadriady.blogspot.com/2012/10/latihan3536110043.html
BalasHapushttp://reskypurwono.blogspot.com/2012/10/prosedur-penyelesaian-latihan3536110037.html
BalasHapushttp://benhilll.blogspot.com/2012/10/deskripsi-dan-prosedur-latihan3536110039.html
BalasHapushttp://rosyanausman.blogspot.com/2012/10/latihan3536110036.html
BalasHapushttp://hasfiahzain.blogspot.com/2012/10/latihan3536110052_28.html
BalasHapushttp://ilhaazzahra.blogspot.com/2012/10/latihan3536110033.html
BalasHapushttp://sriayu-36110030.blogspot.com/2012/10/diskripsi-prosedur-latihan-35.html
BalasHapushttp://rahmisuryatama05.blogspot.com/2012/10/latihan3536110040.html
BalasHapushttp://rainaagrippinaa.blogspot.com/2012/10/latihan3536110032.html
BalasHapushttp://dewiwahyuni91.blogspot.com/2012/10/latihan3536110038.html
BalasHapushttp://audryasharii.blogspot.com/2012/10/latihan3536110031.html
BalasHapushttp://andiniwarakusuma.blogspot.com/2012/10/latihan3536110034.html
BalasHapuszulkiflitryputra.blogspot.com/2012/10/latihan3536110046.html
BalasHapushttp://nurhanalott.blogspot.com/2012/10/latihan3536110029.html
BalasHapushttp://www.masnurselayar.blogspot.com/2012/10/latihan-3536110055.html
BalasHapushttp://ruslancullank1.blogspot.com/2012/10/deskripsilatihan3536110054.html
BalasHapushttp://burhankhang58.blogspot.com/2012/10/latihan3536110047.html
BalasHapushttp://rizka-azisah.blogspot.com/2012/11/deskripsi-penyelesaian-latihan3536110041_9.html
BalasHapus