Click to See Complete Forum and Search --> : dbgrid control: how to accsess values in cell


kishk91
November 10th, 1999, 04:59 AM
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





kishk91@hotmail.com
http://www.path.co.il
ICQ: 13610258

Lothar Haensler
November 10th, 1999, 06:13 AM
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)

kishk91
November 10th, 1999, 07:03 AM
Hi.
thanks man.. its working great...

thanks again
dani


kishk91@hotmail.com
http://www.path.co.il
ICQ: 13610258