Dynamic Access Form

2019-08-07 06:02发布

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!

2条回答
孤傲高冷的网名
2楼-- · 2019-08-07 06:20

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.

查看更多
ら.Afraid
3楼-- · 2019-08-07 06:46

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?

查看更多
登录 后发表回答