简体   繁体   English

ms access-使用子窗体创建新页面选项卡,并用数据填充子窗体

[英]ms access — Create new page tab with a subform and populate subform with data

What I would like to be able to do is when my EditInfo form is loaded, I want to is load the entire client info onto pages. 我想做的是,当加载EditInfo表单时,我想要将整个客户端信息加载到页面上。

I want to be able to create a new tab on my TabCtrlEdit tabcontrol on the edit form, add a subform to the new tab and auto populate the subform with data stored in tables. 我希望能够在编辑表单上的TabCtrlEdit tabcontrol上创建一个新选项卡,向该新选项卡添加一个子表单,并使用表中存储的数据自动填充该子表单。

But I'm a little unsure how to go about this. 但是我有点不确定如何去做。

Thank you! 谢谢!

EDIT--- A little more info. 编辑---更多信息。 Each time the client comes they get a new record stored in my visits table. 每次客户到访时,他们都会获得一条存储在我的访问表中的新记录。 What I would like to do is when the user goes to edit a clients information - It will loop through and give each visit a new tab with the visit subform populated with that visits data. 我想做的是,当用户去编辑客户信息时,它将遍历并给每个访问一个新的选项卡,其中包含访问数据填充的visit子表单。 There could be a varying number of these visits so I would like it to be done when the form loads. 这些访问的数量可能有所不同,因此我希望在加载表单时完成。 Right now the EditInfo form just loads the initial visit information (name, ID etc...) but not the rest of the visits as it is stored in a different table. 现在,EditInfo表单仅加载初始访问信息(名称,ID等),但不会加载其余访问,因为它存储在另一个表中。

Here is the solution I have implemented thanks to everyone help! 在所有人的帮助下,这是我已实施的解决方案!

From my main form I load the edit form using this: 从我的主表单中,使用以下命令加载编辑表单:

DoCmd.OpenForm "frmEdit", acNormal, , "ID='" & txtID.Value & "'", acFormEdit, acWindowNormal

I've got the ID linked to all tables corresponding to my subforms. 我已将ID链接到与我的子表单相对应的所有表。 (Via relationships). (通过关系)。 And I just set the all the forms on the edit form to "Continuous". 我只是将编辑表单上的所有表单都设置为“ Continuous”。

Thanks again to everyone for their help! 再次感谢大家的帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM