Public NotInheritable Class form30a_36109003 Dim anto As New DataTable Dim ndut As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source='" & Application.StartupPath & "\DATABARANG.accdb'")
Private Sub edit_36109003_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles edit_36109003.Click If form30b_36109003.Visible = False Then form30b_36109003.Show() Else form30b_36109003.Activate() End If form30b_36109003.ganti_36109003.Text = dgv_36109003.CurrentRow.Cells("kodebarang").Value form30b_36109003.kb_36109003.Text = dgv_36109003.CurrentRow.Cells("kodebarang").Value form30b_36109003.nb_36109003.Text = dgv_36109003.CurrentRow.Cells("namabarang").Value form30b_36109003.jb_36109003.Text = dgv_36109003.CurrentRow.Cells("jumlahbarang").Value form30b_36109003.hj_36109003.Text = dgv_36109003.CurrentRow.Cells("hargajual").Value End Sub
Private Sub form30a_36109003_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", ndut) anto.Rows.Clear() adapter.Fill(anto) adapter.Dispose() dgv_36109003.DataSource = anto End Sub End Class
Public NotInheritable Class form30b_36109003 Dim arman As New ByIskandar.CariKeDataBaseByIskandar Dim anto As New OleDb.OleDbCommand Dim ndut As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source='" & Application.StartupPath & "\DATABARANG.accdb'")
Private Sub simpan_36109003_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles simpan_36109003.Click If ganti_36109003.Text <> kb_36109003.Text Then arman.AturPencarianDataBase("Barang", "KodeBarang", kb_36109003.Text, 1, ndut) If arman.JumlanBaris > 0 Then MsgBox("kode barang tidak dapat diupdate") Exit Sub End If End If If kb_36109003.Text.Length = 0 Then MsgBox("kode barang harus tercantum") Exit Sub ElseIf nb_36109003.Text.Length = 0 Then MsgBox("nama barang harus tercantum") Exit Sub ElseIf hj_36109003.Text.Length = 0 Then MsgBox("harga jual harus tercantum") Exit Sub ElseIf jb_36109003.Text.Length = 0 Then MsgBox("jumlah barang harus tercantum") Exit Sub End If Dim soe As String = "update barang set kodebarang = '" & kb_36109003.Text & "', namabarang = '" & nb_36109003.Text & "', hargajual = " & Val(hj_36109003.Text) & ", jumlahbarang = " & Val(jb_36109003.Text) & " where kodebarang = '" & kb_36109003.Text & "'" anto = New OleDb.OleDbCommand(soe, ndut) ndut.Open() anto.ExecuteNonQuery() ndut.Close() anto.Dispose() ganti_36109003.Text = "" kb_36109003.Text = "" nb_36109003.Text = "" hj_36109003.Text = "" jb_36109003.Text = "" End Sub End Class
Public Class Form30A Dim dt As New DataTable Dim virgo As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; DATA SOURCE =" & Application.StartupPath & "/Databarang.ACCDB") Public Sub rusna() Dim fm As New OleDb.OleDbDataAdapter fm = New OleDb.OleDbDataAdapter("select * from barang", virgo) dt.Rows.Clear() fm.Fill(dt) fm.Dispose() End Sub Private Sub Form30A_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load rusna() dgv_36109010.DataSource = dt End Sub
Private Sub edit_36109010_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles edit_36109010.Click If Form30B.Visible = False Then Form30B.Show() Else Form30B.Activate() End If
---------------------------- Public Class Form30B Dim rusna As New ByIskandar.CariKeDataBaseByIskandar Dim cm As New OleDb.OleDbCommand Dim virgo As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; DATA SOURCE =" & Application.StartupPath & "/Databarang.ACCDB")
Private Sub simpan_36109010_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles simpan_36109010.Click If KB_36109010.Text.Length = 0 Then MsgBox("Isi rong itu yang kosong") Exit Sub End If
If NB_36109010.Text.Length = 0 Then MsgBox("Isi rong itu yang kosong") Exit Sub End If
If Val(HJ_36109010.Text) = 0 Then MsgBox("Isi rong itu yang kosong") Exit Sub End If
If Val(JB_36109010.Text) = 0 Then MsgBox("Isi rong itu yang kosong") Exit Sub End If
If ganti_36109010.Text <> NB_36109010.Text Then rusna.AturPencarianDataBase("Barang", "KodeBarang", KB_36109010.Text, 1, virgo) If rusna.JumlanBaris > 0 Then MsgBox("Adami kode barang seperti itu") Exit Sub End If End If
cm = New OleDb.OleDbCommand("update barang set kodebarang = '" & KB_36109010.Text & "', namabarang = '" & NB_36109010.Text & "', hargajual = " & Val(HJ_36109010.Text) & ", jumlahbarang = " & Val(JB_36109010.Text) & " where kodebarang = '" & ganti_36109010.Text & "'", virgo)
Public Class Form30A Dim DIEGO As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\DATABARANG.ACCDB") Dim SHARAPOVA As New DataTable
Private Sub Form30A_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load XXX() DGV014.DataSource = SHARAPOVA
End Sub
Private Sub EDIT014_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles EDIT014.Click If Form30B.Visible = False Then Form30B.Show() Else Form30B.Activate() End If
Form30B.KB014.Text = DGV014.CurrentRow.Cells("KODEBARANG").Value Form30B.KB0141.Text = DGV014.CurrentRow.Cells("KODEBARANG").Value Form30B.NB0141.Text = DGV014.CurrentRow.Cells("NAMABARANG").Value Form30B.HJ0141.Text = DGV014.CurrentRow.Cells("HARGAJUAL").Value Form30B.JB0141.Text = DGV014.CurrentRow.Cells("JUMLAHBARANG").Value End Sub
Public Sub XXX() Dim ADAPTER As New OleDb.OleDbDataAdapter ADAPTER = New OleDb.OleDbDataAdapter("SELECT * FROM BARANG", DIEGO) SHARAPOVA.Rows.Clear()
ADAPTER.Fill(SHARAPOVA) ADAPTER.Dispose() End Sub End Class _________________________________________________________________________ Public Class Form30B Dim DIEGO As New OleDb.OleDbConnection("provider = microsoft.ACE.oledb.12.0;data source=" & Application.StartupPath & "\DATABARANG.accdb")
Private Sub SIMPAN014_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SIMPAN014.Click If KB014.Text.Length = 0 Then MsgBox("MASUKKAN KODE BARANG") Exit Sub End If
If NB0141.Text.Length = 0 Then MsgBox("MASUKKAN NAMA BARANG") Exit Sub End If
If Val(HJ0141.Text) = 0 Then MsgBox("MASUKKAN HARGA JUAL") Exit Sub End If
If Val(JB0141.Text) = 0 Then MsgBox("MASUKKAN JUMLAH BARANG") Exit Sub End If
If KB014.Text <> KB0141.Text Then Dim XXX As New ByIskandar.CariKeDataBaseByIskandar XXX.AturPencarianDataBase("BARANG", "KODEBARANG", KB0141.Text, 1, DIEGO) If XXX.JumlanBaris > 0 Then MsgBox(" KODE BARANG SUDAH ADA") Exit Sub End If End If
Dim ABC As New OleDb.OleDbCommand ABC = New OleDb.OleDbCommand("UPDATE BARANG SET KODEBARANG = '" & KB0141.Text & "', NAMABARANG = '" & NB0141.Text & "', HARGAJUAL = " & Val(HJ0141.Text) & ", JUMLAHBARANG = " & Val(JB0141.Text) & " WHERE KODEBARANG = '" & KB014.Text & "'", DIEGO)
Public Class Latihan30A36109046 Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\DATABARANG.accdb;Jet OLEDB:Database Password=14322836") Dim cari As New DataTable
Public Sub ambildata() Dim data As New OleDb.OleDbDataAdapter data = New OleDb.OleDbDataAdapter("SELECT* FROM BARANG", conect) cari.Rows.Clear() data.Fill(cari) data.Dispose()
End Sub
Private Sub latihan30A36109046_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ambildata() DataGridView136109046.DataSource = cari End Sub
Private Sub Button136109046_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button136109046.Click If latihan30B36109046.Visible = False Then latihan30B36109046.Show() Else latihan30B36109046.Activate() End If
Latihan30B36109046.kb36109046.Text = DataGridView136109046.CurrentRow.Cells("KODEBARANG").Value Latihan30B36109046.t136109046.Text = DataGridView136109046.CurrentRow.Cells("KODEBARANG").Value Latihan30B36109046.t236109046.Text = DataGridView136109046.CurrentRow.Cells("NAMABARANG").Value Latihan30B36109046.t336109046.Text = DataGridView136109046.CurrentRow.Cells("HARGAJUAL").Value Latihan30B36109046.t436109046.Text = DataGridView136109046.CurrentRow.Cells("JUMLAHBARANG").Value End Sub
End Class Public Class Latihan30B36109046 Dim Jalan As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\DATABARANG.accdb;Jet OLEDB:Database Password=14322836") Private Sub Button136109046_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button136109046.Click If t136109046.Text.Length = 0 Then MsgBox("kode barang belum terisi") Exit Sub End If If t236109046.Text.Length = 0 Then MsgBox("nama barang belum terisi") Exit Sub End If If Val(t336109046.Text) = 0 Then MsgBox("harga barang belum terisi") Exit Sub End If If Val(t436109046.Text) = 0 Then MsgBox("jumlah barang belum terisi") Exit Sub End If If kb36109046.Text <> t136109046.Text Then Dim PENCARI As New ByIskandar.CariKeDataBaseByIskandar PENCARI.AturPencarianDataBase("BARANG", "KODEBARANG", t136109046.Text, 1, Jalan) If PENCARI.JumlanBaris > 0 Then MsgBox("kode sudah ada") t136109046.Text = " " t236109046.Text = " " t336109046.Text = " " t436109046.Text = " " Exit Sub End If End If Dim Cm As New OleDb.OleDbCommand Cm = New OleDb.OleDbCommand("Update BARANG set KODEBARANG ='" & t136109046.Text & "', NAMABARANG = '" & t236109046.Text & "', HARGAJUAL=" & Val(t336109046.Text) & ", JUMLAHBARANG=" & Val(t436109046.Text) & " where KODEBARANG='" & kb36109046.Text & "'", Jalan) Jalan.Open() Cm.ExecuteNonQuery() Jalan.Close() Cm.Dispose() kb36109046.Text = " " t136109046.Text = " " t236109046.Text = " " t336109046.Text = " " t436109046.Text = " " Latihan30A36109046.ambildata() Me.Close() End Sub End Class
Public Class Form30_A Dim poltek As New DataTable Dim ak As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; DATA SOURCE =" & Application.StartupPath & "/Databarang.ACCDB")
Public Sub uthi() Dim has As New OleDb.OleDbDataAdapter has = New OleDb.OleDbDataAdapter("select * from barang", ak) poltek.Rows.Clear() has.Fill(poltek) has.Dispose() End Sub Private Sub Form30_A_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load uthi() dgv36109016.DataSource = poltek End Sub
Private Sub edit36109016_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles edit36109016.Click If Form30_B.Visible = False Then Form30_B.Show() Else Form30_B.Activate() End If
FORM30-B Public Class Form30_B Dim uthi As New ByIskandar.CariKeDataBaseByIskandar Dim poltek As New OleDb.OleDbCommand Dim ak As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; DATA SOURCE =" & Application.StartupPath & "/Databarang.ACCDB")
Private Sub simpan36109016_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles simpan36109016.Click If kode2_36109016.Text.Length = 0 Then MsgBox("Isi rong itu yang kosong") Exit Sub End If
If nama36109016.Text.Length = 0 Then MsgBox("Isi rong itu yang kosong") Exit Sub End If
If Val(harga36109016.Text) = 0 Then MsgBox("Isi rong itu yang kosong") Exit Sub End If
If Val(jumlah36109016.Text) = 0 Then MsgBox("Isi rong itu yang kosong") Exit Sub End If
If kode1_36109016.Text <> kode2_36109016.Text Then uthi.AturPencarianDataBase("Barang", "KodeBarang", kode2_36109016.Text, 1, ak) If uthi.JumlanBaris > 0 Then MsgBox("Adami kode barang seperti itu") Exit Sub End If End If
Public Class Form30A_36109001 Dim rr As New DataTable Dim imps As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; DATA SOURCE =" & Application.StartupPath & "/Databarang.ACCDB")
Public Sub apreal() Dim apr As New OleDb.OleDbDataAdapter apr = New OleDb.OleDbDataAdapter("select * from barang", imps) rr.Rows.Clear() apr.Fill(rr) apr.Dispose() End Sub
Private Sub Form30A_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load apreal() dgv_001_36109001.DataSource = rr End Sub
Private Sub BTN_001_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTN_001_36109001.Click If Form30B_36109001.Visible = False Then Form30B_36109001.Show() Else Form30B_36109001.Activate() End If
Public Class Form30B_36109001 Dim apreal As New ByIskandar.CariKeDataBaseByIskandar Dim cm As New OleDb.OleDbCommand Dim imps As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; DATA SOURCE =" & Application.StartupPath & "/Databarang.ACCDB")
Private Sub btn1_001_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn1_001_36109001.Click If kb_001_36109001.Text.Length = 0 Then MsgBox("Isi rong itu yang kosong") Exit Sub End If
If nb_001_36109001.Text.Length = 0 Then MsgBox("Isi rong itu yang kosong") Exit Sub End If
If Val(hj_001_36109001.Text) = 0 Then MsgBox("Isi rong itu yang kosong") Exit Sub End If
If Val(jb_001_36109001.Text) = 0 Then MsgBox("Isi rong itu yang kosong") Exit Sub End If
If kb1_001_36109001.Text <> kb_001_36109001.Text Then apreal.AturPencarianDataBase("Barang", "KodeBarang", kb_001_36109001.Text, 1, imps) If apreal.JumlanBaris > 0 Then MsgBox("Adami kode barang seperti itu") Exit Sub End If End If
cm = New OleDb.OleDbCommand("update barang set kodebarang = '" & kb_001_36109001.Text & "', namabarang = '" & nb_001_36109001.Text & "', hargajual = " & Val(hj_001_36109001.Text) & ", jumlahbarang = " & Val(jb_001_36109001.Text) & " where kodebarang = '" & kb1_001_36109001.Text & "'", imps)
Public Class Form30A_36109006 Dim rr As New DataTable Dim muhharun As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; DATA SOURCE =" & Application.StartupPath & "/Databarang.ACCDB")
Public Sub harun36109006() Dim hrn36109006 As New OleDb.OleDbDataAdapter hrn36109006 = New OleDb.OleDbDataAdapter("select * from barang", muhharun) rr.Rows.Clear() hrn36109006.Fill(rr) hrn36109006.Dispose() End Sub
Private Sub Form30A_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load harun36109006() DGV_36109006.DataSource = rr End Sub
Private Sub edit_36109006_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles edit_36109006.Click If Form30B_36109006.Visible = False Then Form30B_36109006.Show() Else Form30B_36109006.Activate() End If
Public Class Form30B_36109006 Dim harun36109006 As New ByIskandar.CariKeDataBaseByIskandar Dim cm As New OleDb.OleDbCommand Dim muhharun As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; DATA SOURCE =" & Application.StartupPath & "/Databarang.ACCDB")
Private Sub simpan_36109006_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles simpan_36109006.Click If kb_001_36109006.Text.Length = 0 Then MsgBox("Isi yang kosong") Exit Sub End If
If nb_001_36109006.Text.Length = 0 Then MsgBox("Isi yang kosong") Exit Sub End If
If Val(hj_001_36109006.Text) = 0 Then MsgBox("Isi yang kosong") Exit Sub End If
If Val(jb_001_36109006.Text) = 0 Then MsgBox("Isi yang kosong") Exit Sub End If
If kb1_001_36109006.Text <> kb_001_36109006.Text Then harun36109006.AturPencarianDataBase("Barang", "KodeBarang", kb_001_36109006.Text, 1, muhharun) If harun36109006.JumlanBaris > 0 Then MsgBox("Adami kode barang seperti itu") Exit Sub End If End If
cm = New OleDb.OleDbCommand("update barang set kodebarang = '" & kb_001_36109006.Text & "', namabarang = '" & nb_001_36109006.Text & "', hargajual = " & Val(hj_001_36109006.Text) & ", jumlahbarang = " & Val(jb_001_36109006.Text) & " where kodebarang = '" & kb1_001_36109006.Text & "'", muhharun)
Public NotInheritable Class form30a_36109003
BalasHapusDim anto As New DataTable
Dim ndut As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source='" & Application.StartupPath & "\DATABARANG.accdb'")
Private Sub edit_36109003_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles edit_36109003.Click
If form30b_36109003.Visible = False Then
form30b_36109003.Show()
Else
form30b_36109003.Activate()
End If
form30b_36109003.ganti_36109003.Text = dgv_36109003.CurrentRow.Cells("kodebarang").Value
form30b_36109003.kb_36109003.Text = dgv_36109003.CurrentRow.Cells("kodebarang").Value
form30b_36109003.nb_36109003.Text = dgv_36109003.CurrentRow.Cells("namabarang").Value
form30b_36109003.jb_36109003.Text = dgv_36109003.CurrentRow.Cells("jumlahbarang").Value
form30b_36109003.hj_36109003.Text = dgv_36109003.CurrentRow.Cells("hargajual").Value
End Sub
Private Sub form30a_36109003_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", ndut)
anto.Rows.Clear()
adapter.Fill(anto)
adapter.Dispose()
dgv_36109003.DataSource = anto
End Sub
End Class
Public NotInheritable Class form30b_36109003
BalasHapusDim arman As New ByIskandar.CariKeDataBaseByIskandar
Dim anto As New OleDb.OleDbCommand
Dim ndut As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source='" & Application.StartupPath & "\DATABARANG.accdb'")
Private Sub simpan_36109003_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles simpan_36109003.Click
If ganti_36109003.Text <> kb_36109003.Text Then
arman.AturPencarianDataBase("Barang", "KodeBarang", kb_36109003.Text, 1, ndut)
If arman.JumlanBaris > 0 Then
MsgBox("kode barang tidak dapat diupdate")
Exit Sub
End If
End If
If kb_36109003.Text.Length = 0 Then
MsgBox("kode barang harus tercantum")
Exit Sub
ElseIf nb_36109003.Text.Length = 0 Then
MsgBox("nama barang harus tercantum")
Exit Sub
ElseIf hj_36109003.Text.Length = 0 Then
MsgBox("harga jual harus tercantum")
Exit Sub
ElseIf jb_36109003.Text.Length = 0 Then
MsgBox("jumlah barang harus tercantum")
Exit Sub
End If
Dim soe As String = "update barang set kodebarang = '" & kb_36109003.Text & "', namabarang = '" & nb_36109003.Text & "', hargajual = " & Val(hj_36109003.Text) & ", jumlahbarang = " & Val(jb_36109003.Text) & " where kodebarang = '" & kb_36109003.Text & "'"
anto = New OleDb.OleDbCommand(soe, ndut)
ndut.Open()
anto.ExecuteNonQuery()
ndut.Close()
anto.Dispose()
ganti_36109003.Text = ""
kb_36109003.Text = ""
nb_36109003.Text = ""
hj_36109003.Text = ""
jb_36109003.Text = ""
End Sub
End Class
RUSNANINGSI R
BalasHapus36109010
Public Class Form30A
Dim dt As New DataTable
Dim virgo As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; DATA SOURCE =" & Application.StartupPath & "/Databarang.ACCDB")
Public Sub rusna()
Dim fm As New OleDb.OleDbDataAdapter
fm = New OleDb.OleDbDataAdapter("select * from barang", virgo)
dt.Rows.Clear()
fm.Fill(dt)
fm.Dispose()
End Sub
Private Sub Form30A_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
rusna()
dgv_36109010.DataSource = dt
End Sub
Private Sub edit_36109010_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles edit_36109010.Click
If Form30B.Visible = False Then
Form30B.Show()
Else
Form30B.Activate()
End If
Form30B.ganti_36109010.Text = dgv_36109010.CurrentRow.Cells("kodebarang").Value
Form30B.KB_36109010.Text = dgv_36109010.CurrentRow.Cells("kodebarang").Value
Form30B.NB_36109010.Text = dgv_36109010.CurrentRow.Cells("namabarang").Value
Form30B.HJ_36109010.Text = dgv_36109010.CurrentRow.Cells("hargajual").Value
Form30B.JB_36109010.Text = dgv_36109010.CurrentRow.Cells("jumlahbarang").Value
Form30B.Show()
End Sub
End Class
----------------------------
Public Class Form30B
Dim rusna As New ByIskandar.CariKeDataBaseByIskandar
Dim cm As New OleDb.OleDbCommand
Dim virgo As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; DATA SOURCE =" & Application.StartupPath & "/Databarang.ACCDB")
Private Sub simpan_36109010_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles simpan_36109010.Click
If KB_36109010.Text.Length = 0 Then
MsgBox("Isi rong itu yang kosong")
Exit Sub
End If
If NB_36109010.Text.Length = 0 Then
MsgBox("Isi rong itu yang kosong")
Exit Sub
End If
If Val(HJ_36109010.Text) = 0 Then
MsgBox("Isi rong itu yang kosong")
Exit Sub
End If
If Val(JB_36109010.Text) = 0 Then
MsgBox("Isi rong itu yang kosong")
Exit Sub
End If
If ganti_36109010.Text <> NB_36109010.Text Then
rusna.AturPencarianDataBase("Barang", "KodeBarang", KB_36109010.Text, 1, virgo)
If rusna.JumlanBaris > 0 Then
MsgBox("Adami kode barang seperti itu")
Exit Sub
End If
End If
cm = New OleDb.OleDbCommand("update barang set kodebarang = '" & KB_36109010.Text & "', namabarang = '" & NB_36109010.Text & "', hargajual = " & Val(HJ_36109010.Text) & ", jumlahbarang = " & Val(JB_36109010.Text) & " where kodebarang = '" & ganti_36109010.Text & "'", virgo)
virgo.Open()
cm.ExecuteNonQuery()
virgo.Close()
cm.Dispose()
ganti_36109010.Text = ""
KB_36109010.Text = ""
NB_36109010.Text = ""
HJ_36109010.Text = ""
JB_36109010.Text = ""
Form30A.rusna()
End Sub
End Class
Public Class Form30A
BalasHapusDim DIEGO As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\DATABARANG.ACCDB")
Dim SHARAPOVA As New DataTable
Private Sub Form30A_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
XXX()
DGV014.DataSource = SHARAPOVA
End Sub
Private Sub EDIT014_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles EDIT014.Click
If Form30B.Visible = False Then
Form30B.Show()
Else
Form30B.Activate()
End If
Form30B.KB014.Text = DGV014.CurrentRow.Cells("KODEBARANG").Value
Form30B.KB0141.Text = DGV014.CurrentRow.Cells("KODEBARANG").Value
Form30B.NB0141.Text = DGV014.CurrentRow.Cells("NAMABARANG").Value
Form30B.HJ0141.Text = DGV014.CurrentRow.Cells("HARGAJUAL").Value
Form30B.JB0141.Text = DGV014.CurrentRow.Cells("JUMLAHBARANG").Value
End Sub
Public Sub XXX()
Dim ADAPTER As New OleDb.OleDbDataAdapter
ADAPTER = New OleDb.OleDbDataAdapter("SELECT * FROM BARANG", DIEGO)
SHARAPOVA.Rows.Clear()
ADAPTER.Fill(SHARAPOVA)
ADAPTER.Dispose()
End Sub
End Class
_________________________________________________________________________
Public Class Form30B
Dim DIEGO As New OleDb.OleDbConnection("provider = microsoft.ACE.oledb.12.0;data source=" & Application.StartupPath & "\DATABARANG.accdb")
Private Sub SIMPAN014_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SIMPAN014.Click
If KB014.Text.Length = 0 Then
MsgBox("MASUKKAN KODE BARANG")
Exit Sub
End If
If NB0141.Text.Length = 0 Then
MsgBox("MASUKKAN NAMA BARANG")
Exit Sub
End If
If Val(HJ0141.Text) = 0 Then
MsgBox("MASUKKAN HARGA JUAL")
Exit Sub
End If
If Val(JB0141.Text) = 0 Then
MsgBox("MASUKKAN JUMLAH BARANG")
Exit Sub
End If
If KB014.Text <> KB0141.Text Then
Dim XXX As New ByIskandar.CariKeDataBaseByIskandar
XXX.AturPencarianDataBase("BARANG", "KODEBARANG", KB0141.Text, 1, DIEGO)
If XXX.JumlanBaris > 0 Then
MsgBox(" KODE BARANG SUDAH ADA")
Exit Sub
End If
End If
Dim ABC As New OleDb.OleDbCommand
ABC = New OleDb.OleDbCommand("UPDATE BARANG SET KODEBARANG = '" & KB0141.Text & "', NAMABARANG = '" & NB0141.Text & "', HARGAJUAL = " & Val(HJ0141.Text) & ", JUMLAHBARANG = " & Val(JB0141.Text) & " WHERE KODEBARANG = '" & KB014.Text & "'", DIEGO)
DIEGO.Open()
ABC.ExecuteNonQuery()
DIEGO.Close()
KB014.Text = ""
NB0141.Text = ""
HJ0141.Text = ""
JB0141.Text = ""
Form30A.XXX()
End Sub
End Class
Public Class Latihan30A36109046
BalasHapusDim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\DATABARANG.accdb;Jet OLEDB:Database Password=14322836")
Dim cari As New DataTable
Public Sub ambildata()
Dim data As New OleDb.OleDbDataAdapter
data = New OleDb.OleDbDataAdapter("SELECT* FROM BARANG", conect)
cari.Rows.Clear()
data.Fill(cari)
data.Dispose()
End Sub
Private Sub latihan30A36109046_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ambildata()
DataGridView136109046.DataSource = cari
End Sub
Private Sub Button136109046_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button136109046.Click
If latihan30B36109046.Visible = False Then
latihan30B36109046.Show()
Else
latihan30B36109046.Activate()
End If
Latihan30B36109046.kb36109046.Text = DataGridView136109046.CurrentRow.Cells("KODEBARANG").Value
Latihan30B36109046.t136109046.Text = DataGridView136109046.CurrentRow.Cells("KODEBARANG").Value
Latihan30B36109046.t236109046.Text = DataGridView136109046.CurrentRow.Cells("NAMABARANG").Value
Latihan30B36109046.t336109046.Text = DataGridView136109046.CurrentRow.Cells("HARGAJUAL").Value
Latihan30B36109046.t436109046.Text = DataGridView136109046.CurrentRow.Cells("JUMLAHBARANG").Value
End Sub
End Class
Public Class Latihan30B36109046
Dim Jalan As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\DATABARANG.accdb;Jet OLEDB:Database Password=14322836")
Private Sub Button136109046_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button136109046.Click
If t136109046.Text.Length = 0 Then
MsgBox("kode barang belum terisi")
Exit Sub
End If
If t236109046.Text.Length = 0 Then
MsgBox("nama barang belum terisi")
Exit Sub
End If
If Val(t336109046.Text) = 0 Then
MsgBox("harga barang belum terisi")
Exit Sub
End If
If Val(t436109046.Text) = 0 Then
MsgBox("jumlah barang belum terisi")
Exit Sub
End If
If kb36109046.Text <> t136109046.Text Then
Dim PENCARI As New ByIskandar.CariKeDataBaseByIskandar
PENCARI.AturPencarianDataBase("BARANG", "KODEBARANG", t136109046.Text, 1, Jalan)
If PENCARI.JumlanBaris > 0 Then
MsgBox("kode sudah ada")
t136109046.Text = " "
t236109046.Text = " "
t336109046.Text = " "
t436109046.Text = " "
Exit Sub
End If
End If
Dim Cm As New OleDb.OleDbCommand
Cm = New OleDb.OleDbCommand("Update BARANG set KODEBARANG ='" & t136109046.Text & "', NAMABARANG = '" & t236109046.Text & "', HARGAJUAL=" & Val(t336109046.Text) & ", JUMLAHBARANG=" & Val(t436109046.Text) & " where KODEBARANG='" & kb36109046.Text & "'", Jalan)
Jalan.Open()
Cm.ExecuteNonQuery()
Jalan.Close()
Cm.Dispose()
kb36109046.Text = " "
t136109046.Text = " "
t236109046.Text = " "
t336109046.Text = " "
t436109046.Text = " "
Latihan30A36109046.ambildata()
Me.Close()
End Sub
End Class
Komentar ini telah dihapus oleh pengarang.
BalasHapusRUSNANINGSI R
BalasHapus36109010
http://rusnaningsi.blogspot.com/2011/11/latihan-27-30-apkom-4.html
amelia indahsari
BalasHapus361 09 023
http://heiamee.blogspot.com/2011/11/form-30.html
Ismi Febriani Asyikin
BalasHapus3a D3
361 09 005
http://ismifebriani.blogspot.com/2011/11/apkom-4-latihan-29-30.html
HASTUTI
BalasHapus36109016
FORM30-A
Public Class Form30_A
Dim poltek As New DataTable
Dim ak As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; DATA SOURCE =" & Application.StartupPath & "/Databarang.ACCDB")
Public Sub uthi()
Dim has As New OleDb.OleDbDataAdapter
has = New OleDb.OleDbDataAdapter("select * from barang", ak)
poltek.Rows.Clear()
has.Fill(poltek)
has.Dispose()
End Sub
Private Sub Form30_A_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
uthi()
dgv36109016.DataSource = poltek
End Sub
Private Sub edit36109016_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles edit36109016.Click
If Form30_B.Visible = False Then
Form30_B.Show()
Else
Form30_B.Activate()
End If
Form30_B.kode1_36109016.Text = dgv36109016.CurrentRow.Cells("kodebarang").Value
Form30_B.kode2_36109016.Text = dgv36109016.CurrentRow.Cells("kodebarang").Value
Form30_B.nama36109016.Text = dgv36109016.CurrentRow.Cells("namabarang").Value
Form30_B.harga36109016.Text = dgv36109016.CurrentRow.Cells("hargajual").Value
Form30_B.jumlah36109016.Text = dgv36109016.CurrentRow.Cells("jumlahbarang").Value
Form30_B.Show()
End Sub
End Class
FORM30-B
Public Class Form30_B
Dim uthi As New ByIskandar.CariKeDataBaseByIskandar
Dim poltek As New OleDb.OleDbCommand
Dim ak As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; DATA SOURCE =" & Application.StartupPath & "/Databarang.ACCDB")
Private Sub simpan36109016_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles simpan36109016.Click
If kode2_36109016.Text.Length = 0 Then
MsgBox("Isi rong itu yang kosong")
Exit Sub
End If
If nama36109016.Text.Length = 0 Then
MsgBox("Isi rong itu yang kosong")
Exit Sub
End If
If Val(harga36109016.Text) = 0 Then
MsgBox("Isi rong itu yang kosong")
Exit Sub
End If
If Val(jumlah36109016.Text) = 0 Then
MsgBox("Isi rong itu yang kosong")
Exit Sub
End If
If kode1_36109016.Text <> kode2_36109016.Text Then
uthi.AturPencarianDataBase("Barang", "KodeBarang", kode2_36109016.Text, 1, ak)
If uthi.JumlanBaris > 0 Then
MsgBox("Adami kode barang seperti itu")
Exit Sub
End If
End If
poltek = New OleDb.OleDbCommand("update barang set kodebarang = '" & kode2_36109016.Text & "', namabarang = '" & nama36109016.Text & "', hargajual = " & Val(harga36109016.Text) & ", jumlahbarang = " & Val(jumlah36109016.Text) & " where kodebarang = '" & kode1_36109016.Text & "'", ak)
ak.Open()
poltek.ExecuteNonQuery()
ak.Close()
poltek.Dispose()
kode1_36109016.Text = ""
kode2_36109016.Text = ""
nama36109016.Text = ""
harga36109016.Text = ""
jumlah36109016.Text = ""
Form30_A.uthi()
End Sub
End Class
Public Class Form30A_36109001
BalasHapusDim rr As New DataTable
Dim imps As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; DATA SOURCE =" & Application.StartupPath & "/Databarang.ACCDB")
Public Sub apreal()
Dim apr As New OleDb.OleDbDataAdapter
apr = New OleDb.OleDbDataAdapter("select * from barang", imps)
rr.Rows.Clear()
apr.Fill(rr)
apr.Dispose()
End Sub
Private Sub Form30A_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
apreal()
dgv_001_36109001.DataSource = rr
End Sub
Private Sub BTN_001_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTN_001_36109001.Click
If Form30B_36109001.Visible = False Then
Form30B_36109001.Show()
Else
Form30B_36109001.Activate()
End If
Form30B_36109001.kb1_001_36109001.Text = dgv_001_36109001.CurrentRow.Cells("kodebarang").Value
Form30B_36109001.kb_001_36109001.Text = dgv_001_36109001.CurrentRow.Cells("kodebarang").Value
Form30B_36109001.nb_001_36109001.Text = dgv_001_36109001.CurrentRow.Cells("namabarang").Value
Form30B_36109001.hj_001_36109001.Text = dgv_001_36109001.CurrentRow.Cells("hargajual").Value
Form30B_36109001.jb_001_36109001.Text = dgv_001_36109001.CurrentRow.Cells("jumlahbarang").Value
Form30B_36109001.Show()
End Sub
End Class
Public Class Form30B_36109001
Dim apreal As New ByIskandar.CariKeDataBaseByIskandar
Dim cm As New OleDb.OleDbCommand
Dim imps As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; DATA SOURCE =" & Application.StartupPath & "/Databarang.ACCDB")
Private Sub btn1_001_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn1_001_36109001.Click
If kb_001_36109001.Text.Length = 0 Then
MsgBox("Isi rong itu yang kosong")
Exit Sub
End If
If nb_001_36109001.Text.Length = 0 Then
MsgBox("Isi rong itu yang kosong")
Exit Sub
End If
If Val(hj_001_36109001.Text) = 0 Then
MsgBox("Isi rong itu yang kosong")
Exit Sub
End If
If Val(jb_001_36109001.Text) = 0 Then
MsgBox("Isi rong itu yang kosong")
Exit Sub
End If
If kb1_001_36109001.Text <> kb_001_36109001.Text Then
apreal.AturPencarianDataBase("Barang", "KodeBarang", kb_001_36109001.Text, 1, imps)
If apreal.JumlanBaris > 0 Then
MsgBox("Adami kode barang seperti itu")
Exit Sub
End If
End If
cm = New OleDb.OleDbCommand("update barang set kodebarang = '" & kb_001_36109001.Text & "', namabarang = '" & nb_001_36109001.Text & "', hargajual = " & Val(hj_001_36109001.Text) & ", jumlahbarang = " & Val(jb_001_36109001.Text) & " where kodebarang = '" & kb1_001_36109001.Text & "'", imps)
imps.Open()
cm.ExecuteNonQuery()
imps.Close()
cm.Dispose()
kb1_001_36109001.Text = ""
kb_001_36109001.Text = ""
nb_001_36109001.Text = ""
hj_001_36109001.Text = ""
jb_001_36109001.Text = ""
Form30A_36109001.apreal()
End Sub
Private Sub Form30B_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
End Class
Public Class Form30A_36109006
BalasHapusDim rr As New DataTable
Dim muhharun As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; DATA SOURCE =" & Application.StartupPath & "/Databarang.ACCDB")
Public Sub harun36109006()
Dim hrn36109006 As New OleDb.OleDbDataAdapter
hrn36109006 = New OleDb.OleDbDataAdapter("select * from barang", muhharun)
rr.Rows.Clear()
hrn36109006.Fill(rr)
hrn36109006.Dispose()
End Sub
Private Sub Form30A_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
harun36109006()
DGV_36109006.DataSource = rr
End Sub
Private Sub edit_36109006_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles edit_36109006.Click
If Form30B_36109006.Visible = False Then
Form30B_36109006.Show()
Else
Form30B_36109006.Activate()
End If
Form30B_36109006.kb1_001_36109006.Text = DGV_36109006.CurrentRow.Cells("kodebarang").Value
Form30B_36109006.kb_001_36109006.Text = DGV_36109006.CurrentRow.Cells("kodebarang").Value
Form30B_36109006.nb_001_36109006.Text = DGV_36109006.CurrentRow.Cells("namabarang").Value
Form30B_36109006.hj_001_36109006.Text = DGV_36109006.CurrentRow.Cells("hargajual").Value
Form30B_36109006.jb_001_36109006.Text = DGV_36109006.CurrentRow.Cells("jumlahbarang").Value
Form30B_36109006.Show()
End Sub
End Class
Public Class Form30B_36109006
BalasHapusDim harun36109006 As New ByIskandar.CariKeDataBaseByIskandar
Dim cm As New OleDb.OleDbCommand
Dim muhharun As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; DATA SOURCE =" & Application.StartupPath & "/Databarang.ACCDB")
Private Sub simpan_36109006_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles simpan_36109006.Click
If kb_001_36109006.Text.Length = 0 Then
MsgBox("Isi yang kosong")
Exit Sub
End If
If nb_001_36109006.Text.Length = 0 Then
MsgBox("Isi yang kosong")
Exit Sub
End If
If Val(hj_001_36109006.Text) = 0 Then
MsgBox("Isi yang kosong")
Exit Sub
End If
If Val(jb_001_36109006.Text) = 0 Then
MsgBox("Isi yang kosong")
Exit Sub
End If
If kb1_001_36109006.Text <> kb_001_36109006.Text Then
harun36109006.AturPencarianDataBase("Barang", "KodeBarang", kb_001_36109006.Text, 1, muhharun)
If harun36109006.JumlanBaris > 0 Then
MsgBox("Adami kode barang seperti itu")
Exit Sub
End If
End If
cm = New OleDb.OleDbCommand("update barang set kodebarang = '" & kb_001_36109006.Text & "', namabarang = '" & nb_001_36109006.Text & "', hargajual = " & Val(hj_001_36109006.Text) & ", jumlahbarang = " & Val(jb_001_36109006.Text) & " where kodebarang = '" & kb1_001_36109006.Text & "'", muhharun)
muhharun.Open()
cm.ExecuteNonQuery()
muhharun.Close()
cm.Dispose()
kb1_001_36109006.Text = ""
kb_001_36109006.Text = ""
nb_001_36109006.Text = ""
hj_001_36109006.Text = ""
jb_001_36109006.Text = ""
Form30A_36109006.harun36109006()
End Sub
End Class
ANDI WAHYUNI
BalasHapus361 09 019
http://wahyunistrongggg.blogspot.com/2011/11/latihan-27-32.html
iwan
BalasHapus361 09 026
3A-D3
http://iwandinejad.blogspot.com/#!/2012/01/latihan-30a-dan-30b-apkom-4.html
Komentar ini telah dihapus oleh pengarang.
BalasHapus