Hi Guys ... I need some help on this... i know i've followed the right
declarations on this.. or if not i may be close on hitting it. And i
know there's something wrong with this code.
This is what i did... it adds a new row into the data table... with
values like department, sales glcode etc. when i click the insert/add
button it creates a new row with the values on it. but the second time
i try to insert a new row into the datatable,(via insert/add button
click) it doesnt add another row instead it overwrites the first
value inserted... i cant see where i went wrong or what is the right
property to call (rows.add or what?).
Any Help is very much appreciated!
thanks!
Dim i As Integer
For i = 1 To 1
Row1 = WarehouseDataTa ble.NewRow
Row1.Item("Depa rtment") = "Department " & i
Row1.Item("Sale s GL Code") = "Sales GL Code" & i
Row1.Item("Cost of Sales") = "Cost of Sales" & i
Row1.Item("Inve ntory") = "Inventory" & i
Row1.Item("Expe nse GL Code") = "Expense GL Code" & i
Row1.Item("Read er's Fee GL Code") = "Reader's Fee GL Code" & i
Row1.Item("Depa rtment") = CStr(Me.cmbDepa rtment.Text)
Row1.Item("Sale s GL Code") = (Me.txtSalesGLC ode.Text)
Row1.Item("Cost of Sales") = (Me.txtCOSGLCod e.Text)
Row1.Item("Inve ntory") = (Me.txtInventor yGLCode.Text)
Row1.Item("Expe nse GL Code") = (Me.txtExpenseG LCode.Text)
Row1.Item("Read er's Fee GL Code") = (Me.txtReadersF eeGLCode.Text)
WarehouseDataTa ble.Rows.Add(Ro w1)
Next
Joel <----newbie!
declarations on this.. or if not i may be close on hitting it. And i
know there's something wrong with this code.
This is what i did... it adds a new row into the data table... with
values like department, sales glcode etc. when i click the insert/add
button it creates a new row with the values on it. but the second time
i try to insert a new row into the datatable,(via insert/add button
click) it doesnt add another row instead it overwrites the first
value inserted... i cant see where i went wrong or what is the right
property to call (rows.add or what?).
Any Help is very much appreciated!
thanks!
Dim i As Integer
For i = 1 To 1
Row1 = WarehouseDataTa ble.NewRow
Row1.Item("Depa rtment") = "Department " & i
Row1.Item("Sale s GL Code") = "Sales GL Code" & i
Row1.Item("Cost of Sales") = "Cost of Sales" & i
Row1.Item("Inve ntory") = "Inventory" & i
Row1.Item("Expe nse GL Code") = "Expense GL Code" & i
Row1.Item("Read er's Fee GL Code") = "Reader's Fee GL Code" & i
Row1.Item("Depa rtment") = CStr(Me.cmbDepa rtment.Text)
Row1.Item("Sale s GL Code") = (Me.txtSalesGLC ode.Text)
Row1.Item("Cost of Sales") = (Me.txtCOSGLCod e.Text)
Row1.Item("Inve ntory") = (Me.txtInventor yGLCode.Text)
Row1.Item("Expe nse GL Code") = (Me.txtExpenseG LCode.Text)
Row1.Item("Read er's Fee GL Code") = (Me.txtReadersF eeGLCode.Text)
WarehouseDataTa ble.Rows.Add(Ro w1)
Next
Joel <----newbie!
Comment