unbound checkbox in datasheet view?

L

LF

I have a form with a single unbound checkbox with code behind it's
AfterUpdate event that updates the value of a bound field; this works as
expected in form view but not datasheet view.

The checkbox is replicated for each datasheet record as expected, but when a
single records checkbox is clicked all of the records are simultaneously
checked/unchecked (although the code is still correctly applied to only the
current record). Is there a way to control the displayed checkbox
independently for each record without making it a bound control?

Your suggestions are appreciated.
 
F

fredg

I have a form with a single unbound checkbox with code behind it's
AfterUpdate event that updates the value of a bound field; this works as
expected in form view but not datasheet view.

The checkbox is replicated for each datasheet record as expected, but when a
single records checkbox is clicked all of the records are simultaneously
checked/unchecked (although the code is still correctly applied to only the
current record). Is there a way to control the displayed checkbox
independently for each record without making it a bound control?

Your suggestions are appreciated.

That's not how you do it.
You need to first add a new check box field to your underlying table.
Then add it to the form so that it is BOUND to that field in the
table. No Update code needed.
 
Joined
Jun 9, 2022
Messages
1
Reaction score
0
That's not how you do it.
You need to first add a new check box field to your underlying table.
Then add it to the form so that it is BOUND to that field in the
table. No Update code needed.

Well, and if I don't want an additional field in my table? Lets say my form basis on a result set from a left join. Further, one column may hold a foreign key as field value or NULL if missing. Now I want to map this column to a UI element. Lets says the element shall be a check box.

I am struggling here for a while to find the correct solution to implement this. My naive attempt was to bind a expression to that check box that maps the column value to the respective boolean. But I am not allowed to "alter" the check box state, as this is bounded - as the thread opener already pointed out. And I am also only interested in executing an request if someone clicks on that checkbox.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top