Connecting Tech Pros Worldwide Help | Site Map

How can send selected data from a datagrid to another datagrid?

Newbie
 
Join Date: Oct 2009
Posts: 5
#1: Oct 16 '09
I have created a List of contents in a database table which will display in Datagrid window. The user may select one or many data from the Datagrid. If data selected data should be shown in Another datagrid. If a content is not available user may be allowed to add additional 'List of contents'. The addl. data also to be included automatically in that database table. The project is for our deaf association. Advance thanks pl.
Newbie
 
Join Date: Jul 2007
Posts: 6
#2: 4 Weeks Ago

re: How can send selected data from a datagrid to another datagrid?


''' may be this will help you
Expand|Select|Wrap|Line Numbers
  1. Private Sub DataGrid1_KeyDown(KeyCode As Integer, Shift As Integer)
  2.  
  3. If KeyCode = 13 Then
  4. If TL.State = 1 Then TL.Close
  5. TL.Open "select Field Name from Table Name where Field Name  = " & DataGrid1.text & "", con, adOpenKeyset, adLockOptimistic
  6.  
  7. '''Storing this records to another table
  8.  
  9. With TL
  10. .AddNew
  11.     ! FieldName = DataGrid1.Columns(0)
  12.     .Update
  13.     .Close
  14. End With
  15.  
  16. If TL.State = 1 Then TL.Close
  17. TL.Open "select Field Name from Tabel 2 order by Field Name", con, adOpenKeyset, adLockPessimistic
  18.  
  19. If TL.RecordCount > 0 Then
  20.    Set DataGrid2.DataSource = TL
  21. End If
  22.     End If
  23.  
Newbie
 
Join Date: Oct 2009
Posts: 5
#3: 4 Weeks Ago

re: How can send selected data from a datagrid to another datagrid?


Problem is in
If TL.State = 1 Then TL.Close
(TL ...not described in declaration..so please explain)
Reply