Carl, thank you very much for your help.
What do I want if the user unchecks a checkbox? Well, in that case the entry
in the junction table should be deleted.
I would like the form to operate as if the checkboxes were bound to
individual fields. That means that on opening the form on an existing record
(i.e. on a respondent whose answers have been introduced already) the form
should show checked checkboxes for every question that has an entry in the
junction table. Any change (from checked to unchecked or the other way
around) should cause the corresponding change (insertion or deletion) in the
table.
Can this be done by programming the AfterUpdate event of each of the
checkboxes? Do you think the amount of code would have a negative effect on
performance?
And if I use your second suggestion, doesn't that mean that the information
gets lost if the user forgets to click the button? My form has a lot of other
controls on it, apart from the group that corresponds to the survey
questions, so forgetting to push the button is something that could easily
happen.
I hope you are willing to give some more thought to the problem.
Yes, you could do that in the AfterUpdate event of each checkbox control. It
may or may not be slow, depending on the connection with your back-end
tables. As I said, it would be a lot of redundant code, but there's no
reason you couldn't do it that way. Alternatively, you could create a
procedure that does the insert and call that procedure in each AfterUpdate
event, passing the specific checkbox control as a parameter to the
procedure. That would reduce the redundancy.
And yes, if you went with my second suggestion the user would need to
remember to click the button. You could handle that by setting some sort of
flag internally whenever a checkbox is checked/unchecked, and test for that
flag when the form closes. In the click event of the button you would clear
that flag, so the form could close normally.
But there's no reason it wouldn't work your way, if that's your preference.
I'd say try it and see what the performance is like. If there's no noticable
delay when clicking each checkbox, then you're fine.
Carl Rapson
> Carl, thank you very much for your help.
> What do I want if the user unchecks a checkbox? Well, in that case the
[quoted text clipped - 21 lines]
> happen.
> I hope you are willing to give some more thought to the problem.
<snip>
Wim - 08 Mar 2007 22:06 GMT
Thanks, Carl, for your helpful comments. I guess I'll just have to experiment
with various options. Still I find it curious that there is no standard
solution for what seems to be a rather common problem (basically what I want
is a "multi-option option group").
Well, thanks again for your help.
> Yes, you could do that in the AfterUpdate event of each checkbox control. It
> may or may not be slow, depending on the connection with your back-end
[quoted text clipped - 43 lines]
> >
> <snip>