Checkboxes: Dynamically Adding At Form_Load?

P

(PeteCresswell)

We have a table where each row represents a bond "Deal".

Each "Deal" has a "Status". Currently possible statuses are:
---------------------------------------
0 - Unknown
1 - Currently Owned
2 - Owned in the past, but not currently owned
3 - Under Review: we're interested in it, but don't own it yet
4 - Declined: We've looked at it, but decided to pass...
---------------------------------------

When the user is browsing the "Deal" list, they can select various subsets of
the list including "Status". To that end, I pop a little dialog form that has
the currently-known statuses on it - each represented by a checkbox. The user
checks the boxes he's interested in, hits "Ok", and the list is refreshed to
contain that subset.

So far, so good.

But what happens if/when the user decides to add a new status? How about if
the user edits tlkpStatus and changes "Currently Owned" to something like
"Committed"? Now the selection dialog is broken.

The Good-Right-And-Holy path would seem to be to dynamically build the form
using tlkpStatus.

I thought about adding checkbox objects depending... but figure that would
result in application bloat each time the user closed the form - plus I'd have
to deal with "Do you want to save the changed form"...

Alternatively, what I come up with is a subform in the selection dialog that
looks into a little work table created by copying tlkpStatus and adding a
IsSelected field - represented by a checkbox.

Anybody else been here? Is there a more elegant solution?
 
G

Guest

Pete:

My inclination would be to use a multi-select list box rather than the check
boxes. The list items would have a query on the tlkpStatus table as its
RowSource, so would show whatever the values of the Status column currently
are. To process the user's selections from the list box you'd iterate
through its ItemsSelected collection in code This is a collection of
variants, each being a integer index to a selected item in the list. Check
it out in VBA Help for how to work with it.

Ken Sheridan
Stafford,
 

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