MS Access 根据子表单的焦点自动填充主表单
我有一个带有两个组合框(名称和组)的数据输入/编辑表单。
- 每个组与多个名称相关,但每个名称仅属于一个组。
- 该表单的底部是一个子表单,它是一个连续表单 显示根据过滤的关联表的查询 您可以从中选择组的未绑定组合。
基本上,您选择要查看的组,它会显示该组中所有名称的列表。
我想让这个表单能够从表中添加和删除名称(它已经使用按钮完成了),但我也希望能够选择 子表单中的名称,并使主表单聚焦于该条目并自动填充两个绑定的组合。
然后,我希望能够编辑并保存该条目,或者只是删除该条目。
同样,我希望能够添加新条目,而不必担心覆盖当前条目。 Access 可能会自动执行此操作;如果是这种情况:
是否可以编辑条目而不删除然后替换它?
I have a data entry/editing form with two combo boxes (Name and Group).
- Each Group correlates to multiple names but each name is in only one group.
- At the bottom of this form is a subform which is a continuous form
displaying a query of the associated table filtered based on an
unbound combo from which you select the group.
Basically, you choose which group you want to see and it displays a list of all the Names in that Group.
I want to make this form able to add and delete Names from the table (which it does with buttons already), but I also want to be able to select a Name from the subform and have the main form focus on that entry and auto fill the two bound combos.
And then from there I would like to be able to edit and save that entry or just delete the entry.
Similarly, I would like to be able to add a new entry without worrying about writing over a current entry. Access might do this automatically; if this is the case:
Is it even possible to edit an entry without deleting and then replacing it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为此,您可以使用子表单中的 ID 对主表单的记录集执行 FindRecord。该表格将移至正确的记录。来自子表单的 OnCurrent 事件:
或
为此,请执行以下代码:
To do that, you can do a FindRecord on the main form's recordset, using the ID from the subform. The form will move to the correct record. From the subform's OnCurrent Event:
or
To do that, execute the following code: