check boxes on a form

crowegreg

Registered User.
Local time
Today, 06:47
Joined
Feb 28, 2011
Messages
108
I have a table that contains options. For this example, let's use colors. The data within this table is edited by the end user. I have a form that has check box options based on the colors within the table. Is it possible for the form to be created dynamically based on the color options. Meaning that when the user selects to open the form, it has 4 check box options because their are 4 color options within the table. If later, a user adds another color to the table, then when the form is opened next, their are 5 check box options. Thanks for your assistance!!
 
Hi

I don't know about creating controls dynamically, but assuming that there will be a finite number of check boxes, you could create the max number of check boxes that could be required and then set the visble property of each check box in the form's Open event.

That said, I think I would use a list box instead of check boxes.
 
Thanks, I'll take it under advisement.
 
Bob's advice here is spot on! Creating Controls dynamically is a very poor idea, much less trying to create a Form in that manner! If you were speaking about an unknown number of Fields, his advice about creating all possible Controls then conditionally controlling their Visibility would be the way to go. But from your stated scenario, with an unknown number of possible options, it sounds as if a Combobox would be a better choice. The colors you're speaking of sound more like multiple possible Values for a single Field, rather than multiple Fields.

With a Combobox based on the Table the number of Colors available for selection would automatically increase as the number of Colors in the Table increased.

Linq ;0)>
 

Users who are viewing this thread

Back
Top Bottom