Hi Guys,
i am doing a project which involves the user double clicking on a row on a datagrid on one form and this action populate the next empty row in another datagrid in another form with that data. I also need the row on the new form to have one cell empty so i can put a quantity in there. I also need to know how to specify the position of the empty cell.
I can populate textboxes from a datagrid but i dont know how to do so for another grid.Thanks for any help. Below is my code for the datagrid:
Set selectStock = New ADODB.Connection
selectStock.ConnectionString = _
"Provider = Microsoft.Jet.OLEDB.4.0; Data Source=C:\My Documents\GP project\gpframings.mdb"
selectStock.Open
Set rsSelect = New ADODB.Recordset
selectSql = "Select stockcode, stockdescription, price From stock"
With rsSelect
.ActiveConnection = selectStock
.CursorLocation = adUseClient
.CursorType = adOpenStatic
.LockType = adLockOptimistic
.Open selectSql
End With
If rsSelect.BOF = True Or rsSelect.EOF = True Then
Exit Sub
End If
Set DataGrid1.DataSource = rsSelect
DataGrid1.Refresh
End Sub
i am doing a project which involves the user double clicking on a row on a datagrid on one form and this action populate the next empty row in another datagrid in another form with that data. I also need the row on the new form to have one cell empty so i can put a quantity in there. I also need to know how to specify the position of the empty cell.
I can populate textboxes from a datagrid but i dont know how to do so for another grid.Thanks for any help. Below is my code for the datagrid:
Set selectStock = New ADODB.Connection
selectStock.ConnectionString = _
"Provider = Microsoft.Jet.OLEDB.4.0; Data Source=C:\My Documents\GP project\gpframings.mdb"
selectStock.Open
Set rsSelect = New ADODB.Recordset
selectSql = "Select stockcode, stockdescription, price From stock"
With rsSelect
.ActiveConnection = selectStock
.CursorLocation = adUseClient
.CursorType = adOpenStatic
.LockType = adLockOptimistic
.Open selectSql
End With
If rsSelect.BOF = True Or rsSelect.EOF = True Then
Exit Sub
End If
Set DataGrid1.DataSource = rsSelect
DataGrid1.Refresh
End Sub