check box in msflexgrid

davieboy_xr
04-17-2004, 06:06 PM
i have a msflexgrid that i have certain columns that are use a check box.I have used flyguys code to get this to work. I need to be able to click the check and return the result back to my database as either true/false or 1 or 0.
How can i connect to the database and read/write these values? -the values would be adainst an id.

TheDutch IceMan
04-18-2004, 04:50 AM
Check the value of the checkBox in that particular row and update your database table

FG1.TextMatrix(FG1.RowSel, yourCheckBoxClumn) will be the column in which the checkbox has been shown.

davieboy_xr
04-18-2004, 12:56 PM
i thought i would have to connect to the database and use a sql statement to retrieve the value inside the table where it equal to the id... any one got any ideas?

TheDutch IceMan
04-18-2004, 02:34 PM
i thought i would have to connect to the database and use a sql statement to retrieve the value inside the table where it equal to the id... any one got any ideas?

As long as you can get the values from the database to fill the grid, why do you have such a hard time to UPDATE the values?????

As I said, use the .TextMatrix(row, col) value inside an UPDATE QUERY....it shouldn't be that hard to find out! :D

1. create connection
2. find the row you've selected with TextMatrix(Row, col) in which the Row value is "yourFG.RowSel", chekc the value of the existing checkbox in that row and use for example " IIF((MSHFlexGrid1.TextMatrix(MSHFlexGrid1.RowSel, 0) = vbChecked, "-1", "0") and use the previous line in the update statement or fill your update variabele with it.....

3. close connection
4. remove the recordset and connection out of mem.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum