T
Tony K
When calling my form from within my MDI, I receive this error message.
InvalidOperationException was unhandled
An error occurred creating the form. See Exception.InnerException for
details. The error is: Index was out of range. Must be non-negative and
less than the size of the collection.
Parameter name: index
This error has to do with one line in particular.
Me.Inventory_TransactionsDataGridView.Rows(e.RowIndex).Cells(0).Value =
Today()
If I rem this line out, the form loads. What I want to do is when a cell in
my DataGridView is changed, insert the date into the 1st column of my DGV.
Here are the first several lines of code:
Private Sub Inventory_TransactionsDataGridView_CellValueChanged(ByVal sender
As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs)
Handles Inventory_TransactionsDataGridView.CellValueChanged
If e.ColumnIndex = 1 Then 'when the part# combo box is changed
(2nd column)
Dim cnnProd As New
OleDbConnection(My.Settings.Inventory_management_databaseConnectionString)
'connection used from app settings
Dim cmmProd As OleDbCommand
Dim strSQL As String 'sql statement
Dim description As String
Dim drdProd As OleDbDataReader
Dim prodID As String
Dim unitPrice As Decimal
Me.Inventory_TransactionsDataGridView.Rows(e.RowIndex).Cells(0).Value
= Today()
The last line is the problem line. In the DataGrid I have default cell
style set as DataGridViewCellStyle { Format=d }
What can I do to correct this exception problem that I am receiving?
Thanks,
Tony K
InvalidOperationException was unhandled
An error occurred creating the form. See Exception.InnerException for
details. The error is: Index was out of range. Must be non-negative and
less than the size of the collection.
Parameter name: index
This error has to do with one line in particular.
Me.Inventory_TransactionsDataGridView.Rows(e.RowIndex).Cells(0).Value =
Today()
If I rem this line out, the form loads. What I want to do is when a cell in
my DataGridView is changed, insert the date into the 1st column of my DGV.
Here are the first several lines of code:
Private Sub Inventory_TransactionsDataGridView_CellValueChanged(ByVal sender
As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs)
Handles Inventory_TransactionsDataGridView.CellValueChanged
If e.ColumnIndex = 1 Then 'when the part# combo box is changed
(2nd column)
Dim cnnProd As New
OleDbConnection(My.Settings.Inventory_management_databaseConnectionString)
'connection used from app settings
Dim cmmProd As OleDbCommand
Dim strSQL As String 'sql statement
Dim description As String
Dim drdProd As OleDbDataReader
Dim prodID As String
Dim unitPrice As Decimal
Me.Inventory_TransactionsDataGridView.Rows(e.RowIndex).Cells(0).Value
= Today()
The last line is the problem line. In the DataGrid I have default cell
style set as DataGridViewCellStyle { Format=d }
What can I do to correct this exception problem that I am receiving?
Thanks,
Tony K