I am creating a dynamic form in Access 2003. Each time the form is opened combo boxes are created based on table of "keywords." My code is having trouble deleting old boxes (or their labels, I'm not sure) and every opening after the first gets hung up on duplicate names (Run-time error '2450').
Secondly, junction table holding the "checked" keywords will fills up at a low finite amount.
Thirdly, I can't figure out how to populate the combo boxes based on the junction table records. When the form is loaded the boxes are always unchecked.
Thanks for any help!
I'd suggest using a continuous subform bound to a junction table with one record per keyword and main record. The kwyword would be a combo box. Ensure you have a "dupe check" index based on both the foriegn main record key and the foriegn keyword key on the junction table.
Do you explicitly destroy the created controls when you close the form? I'm not sure how Access handles stuff like this, but in Delphi when you create a control and put it on a form (all in code) the control is not destroyed when the form is destroyed. For that to work, you must set the owner property of the new control to the form. Maybe Access has a similar possibility?