Results 1 to 3 of 3

Thread: DBgrid Problem in VB5

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 1999
    Posts
    2

    Post

    I have a Grid .I have the data in it and I can output the Entire Record into variables
    and use the data. What I want to do is assign a variable to a specific cell(box) when the user clicks on it and output it that way.
    Help me please

  2. #2
    Lively Member
    Join Date
    Dec 1999
    Location
    Karlsruhe, Germany
    Posts
    122

    Post

    Hi Bill,

    see code below (from MSDN)

    Code:
    Private Sub DBGrid1_RowColChange(LastRow As Variant, ByVal LastCol As Integer)
       ' Print the Text, row, and column of the cell the user clicked.
       Debug.Print DBGrid1.Text; DBGrid1.Row; DBGrid1.Col
    End Sub
    To assign variables to each cell you could create a 2-dim array that you access with row and col.

    Happy New Year
    Roger

  3. #3

    Thread Starter
    New Member
    Join Date
    Dec 1999
    Posts
    2

    Post

    Excellent Roger : Thankyou

    And a Happy new year to you too.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width