子表单数据不更新表
我使用 Access 数据项目运行 MS Access 2010 作为 SQL Server Express 2008 R2 的前端。
我有两个表:“个人”和“研究人员”。
“Individuals”表具有主键“Individual_ID”。 “Researchers”表中名为“Researcher_ID”的外键引用“Individual_ID”。
我创建了一个绑定到“个人”表的表单,并将其设为数据输入表单。然后,我添加了一个绑定到“研究人员”表的子窗体控件,并使用子窗体向导指定了从个人到研究人员的一对多关系。
我可以在主窗体中输入数据,并且它会使用主窗体中的“Individual_ID”填充子窗体中子窗体的“Researcher_ID”字段。这些条目甚至保存在子表单中。
问题:子表单没有将新记录插入到“Researchers”表中,以及我在表单和子表单中创建的新记录......即使它确实将新记录插入到“Individuals”表中。
I am running MS Access 2010 as a front end to SQL Server Express 2008 R2 using an Access Data Project.
I have two tables: "Individuals" and "Researchers".
The "Individuals" table has primary key "Individual_ID". A foreign key in the "Researchers" table called "Researcher_ID" references "Individual_ID".
I created a form bound to the "Individuals" table and made it a Data Entry form. Then I added a subform control bound to the "Researchers" table, and using the subform wizard specified the one-to-many relationship from Individuals to Researchers.
I can enter data into the main form fine, and it populates the subform's "Researcher_ID" field in the subform with the "Individual_ID" from the main form. The entries are even saved within the subform.
The problem: The subform is not inserting new records into the "Researchers" table with the new records I create in the form and subform...even though it does insert new records into the "Individuals" table.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你有主键吗?没有主键就无法写入任何表。
Do you have primary keys? You can't write to any table without a primary key.