Dynamic Access Form

橙三吉。 提交于 2019-12-24 07:35:17

问题


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!


回答1:


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.




回答2:


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?



来源:https://stackoverflow.com/questions/1822628/dynamic-access-form

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!