[AccessD] Data-Driven Checkboxes

JWColby jwcolby at colbyconsulting.com
Wed Jan 3 11:45:49 CST 2007


Arthur,

You might want to consider two lists or a combo and a list box, where when
you select something in the left-hand list, it moves to the right-hand list.
This allows "infinite" expansion with no additional programming effort.
Further it is dead simple (at least for a single user system) since you can
simply put a "selected" column in the source table for the lists, one list
(the left) displays UNSELECTED items, the right hand list displays the
SELECTED items.  Requery the list box after every selection causes them to
"move" from one list to the other.  You could also model this as two views
of the same table, each view displayed in a sub form.  The user can directly
check the "select" check box in the data set and when that happens it
requeries BOTH sub forms to redisplay the data.

John W. Colby
Colby Consulting
www.ColbyConsulting.com

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of artful at rogers.com
Sent: Wednesday, January 03, 2007 11:48 AM
To: Access Developers discussion and problem solving
Subject: [AccessD] Data-Driven Checkboxes

I have a form that I want to populate using a SELECT statement based on
another table. A simple example: the other table contains a list of options
you might want on a computer you're considering buying: 250GB HD, 19"
monitor, 20" monitor, wireless, dvd burner, etc. New components might be
added to the components list at any time, and I don't want to rebuild the
form every time this happens.

What I would like to do is create a checkbox control on the form with one
checkbox for each component, and use the component description as the text
associated with that checkbox. The checkboxes should be 3-way controls (yes,
no, null). Then, code will walk through the values and do some stuff based
on the Ys and Ns. As for naming the generated controls, I plan on doing
something like "cbx_" + ComponentID, so that I can loop through them and
check their values.

Suggestions on how to auto-create the component checkboxes?

A downstream problem that I'm not going to worry about at this stage is
creating two columns of checkboxes if there isn't enough vertical space to
place them all nicely.

TIA,
Arthur


--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list