CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 1999
    Location
    Israel
    Posts
    1,793

    dbgrid control: how to accsess values in cell

    Hello,
    I am writing an app that retrieves data from an access data base to a
    dbgrid control.
    the sql statement I am using - is getting multiple values in one field (from
    different tables).
    Since I want to transform the data in the cell from: value1,value2, value3
    ect' (in a row) to:
    value1
    value2
    value3
    ect'
    (in a column), not necessarily in a dbgrid - can be in a list box as well, I
    need to access the values in the field of the dbgrid.
    I tried all I can think of - but nothing worked.

    I will appreciate any pointers, or even another way of getting the same
    result I am looking for.
    thanks in advance
    Dani





    [email protected]
    http://www.path.co.il
    ICQ: 13610258

  2. #2
    Join Date
    May 1999
    Posts
    3,332

    Re: dbgrid control: how to accsess values in cell

    excerpt from MSDN article Q149094


    Dim vargBookmark as Variant


    private Sub DBGrid1_MouseUp(Button as Integer, Shift as Integer, _
    X as Single, Y as Single)
    igColumn = DBGrid1.ColContaining(X) 'set the Cell Column number
    igRow = DBGrid1.RowContaining(Y) 'set the Cell Row number

    vargBookmark = DBGrid1.RowBookmark(igRow) 'set Bookmark Value

    'Show the contents of the cell in a textbox
    Text1.Text = DBGrid1.Columns(igColumn).CellValue(vargBookmark)






  3. #3
    Join Date
    Jul 1999
    Location
    Israel
    Posts
    1,793

    Re: dbgrid control: how to accsess values in cell

    Hi.
    thanks man.. its working great...

    thanks again
    dani


    [email protected]
    http://www.path.co.il
    ICQ: 13610258

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

Featured