VB Data Grid

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • charithana
    New Member
    • Mar 2008
    • 3

    VB Data Grid

    I Loaded data to a Data Grid from a ActiveX Data Controller. Now i want, when i double clicking on a record (Raw in Data grid), and get the raw data to a form or to a report. beter to get in to a text fields on a form. How to do it, Please help me.
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    try using this
    [code=vb]
    Dim i As Integer
    Dim Str As String
    S = ""
    For i = 0 To DataGrid1.Colum ns.Count - 1
    DataGrid1.Col = i
    Str = Str & " " & DataGrid1.Text
    Next
    MsgBox S[/code]

    Comment

    • charithana
      New Member
      • Mar 2008
      • 3

      #3
      Sorry Dear,

      This is not working. really i want to do is

      I have a database it is using for the letter dispatching purpose.

      it is done by me from using VB6

      I used MS ADO Data control 6 to load data to DataGrid (oledb). It is used as a result viewer of a finding process.

      now i want to do is when i double click on a record it should Load original data to a form.( i using some forms to enter data.) so ill be able to update that record on the form.
      Last edited by charithana; Mar 12 '08, 08:49 AM. Reason: Repeat

      Comment

      • charithana
        New Member
        • Mar 2008
        • 3

        #4
        Sorry Dear,

        This is not working. really i want to do is

        I have a database it is using for the letter dispatching purpose.

        it is done by me from using VB6

        I used MS ADO Data control 6 to load data to DataGrid (oledb). It is used as a result viewer of a finding process.

        now i want to do is when i double click on a record it should Load original data to a form.( i using some forms to enter data.) so ill be able to update that record on the form.

        Comment

        • wireshark
          New Member
          • Mar 2008
          • 29

          #5
          Originally posted by charithana
          Sorry Dear,

          This is not working. really i want to do is
          I have a database it is using for the letter dispatching purpose.
          it is done by me from using VB6
          I used MS ADO Data control 6 to load data to DataGrid (oledb). It is used as a result viewer of a finding process.
          now i want to do is when i double click on a record it should Load original data to a form.( i using some forms to enter data.) so ill be able to update that record on the form.

          Try this...
          use event double click

          Private Sub DataGrid1_DblCl ick()
          Form2.Show
          Form2.Text1 = Adodc1.Recordse t.Fields(0) or Adodc1.recordse t.fields("field name")
          Form2.Text2 = Adodc1.Recordse t.Fields(1)
          End Sub


          hope this is what u want...

          Comment

          Working...