paynea
10-01-2001, 07:31 AM
Hello all,
need some help on this...
i'm using an access DB, and a datagrid in VB.
I would like to set a checkbox up on a column of the data grid against each row in the table - ideally i don't want the checkbox or value on the table.
The datagrid format property calls for a boolean column, but i cant see how that is done in access 2000 (i've tried the yes/no option with true/false as the format which doesn't work)
can anyone help me???
thanks,
A.
"Smoke me a kipper I'll be back for breakfast!"
YaRness
10-01-2001, 08:20 AM
just outta curiosity what do you want the checkbox for? running calculations or grouping select rows?
i'd imagine it might be slightly difficult producing a series of check boxes for the rows, especially making them line up with the rows. i'm asking what you need the checkboxes for because there might be an easier way to get the same functionality, depending on what you need to do.
paynea
10-01-2001, 08:32 AM
i need the checkboxes to select/deselect the actual row.
in the same way a deletion flag on a mail account works...
there is a checkbox property on the datagrid, but it just won't work...
it only returns the boolean values 1 or 0.
i think this is because the column property of the table isn't strictly boolean. access uses the yes/no which returns -1 & 0.
any other thoughts?
thanks,
A.
"Smoke me a kipper I'll be back for breakfast!"
YaRness
10-01-2001, 10:01 AM
as far as i know VB in general uses -1 and 0 for boolean, not 1 and 0. checkbox.value uses whatever value is in the constants vbChecked and vbUnchecked (which may be 1 and 0 for all i know).
do you have a field in the database for this checkbox column? or have you managed to get an unbound field in the datagrid? far as i know the latter can't be done, because i tried, but i'd be interested to know if you did.
----------
"Assembly of Japanese bicycle require great peace of mind."
diver
10-01-2001, 06:05 PM
Let me throw an idea at you that I used once. It works fine. First of all, the whole "checkbox" routine with MS Grid is not available. So, you obviously have the choice of just using a completely separate third party grid control and forget about it. If that doesn't excite you, then what you can do is dynamically create checkboxes using the checkbox control. It doesn't matter where you place them, either in the grid or out of it. Create them dynamically as you load the grid. When you add a row in the grid, you add a checkbox, etc..
Now, when these checkboxes are checked, obviously an Index is thrown out and you can correlate it to your grid and pull your data or whatever.
Will that help?
Diver