“无法添加记录;表___的连接键不在记录集中“错误 [英] "Cannot add record(s); join key of table ___ not in record set" Error

查看:1063
本文介绍了“无法添加记录;表___的连接键不在记录集中“错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我正在尝试为咖啡馆的食品订购数据库开发一个简单的表格(作为学习项目)。我对此很新,所以如果我在错误的部分发帖,我很抱歉。

Hello, I'm trying to develop a simple form for a food ordering database at a cafe (as a learning project). I am fairly new to this so if I am posting in the wrong section, my apologies.

在我添加/修改订单的表格中,我有以下字段:

In a form I made to add/modify an order, I have the following fields:

EmployeeID,客户名,客户姓,BNumber(可选学生ID号),OrderDate(默认为今天的日期)和订单明细,这是一个包含ProductID,Quantity, ProductPrice,TotalPrice和Complete(作为复选框)。

EmployeeID, Customer First Name, Customer Last Name, BNumber (optional student ID number), OrderDate (defaulted to today's date), and the Order Details, which is a subform that contains ProductID, Quantity, ProductPrice, TotalPrice, and Complete (as a checkbox).

现在,当我尝试选择要分配给订单的员工时,它会给我这个错误:

Now, when I try to select an employee to assign to the order, it gives me this error:

"无法添加记录;连接表的订单订单不在记录集中  

"Cannot add record(s); join key of table Orders not in record set" 

employeeID字段是一个组合框,其中包含ID(隐藏了列宽),以及姓氏和名字。

The employeeID field is a combobox that contains the ID (hidden with the column widths), and Last and First names.

此外,在Customer First,Last或BNumber中输入任何内容会导致以下错误:"字段无法更新。"

Also, entering anything into the Customer First, Last, or BNumber results in the following error: "Field cannot be updated."

我已经提到了一个针对类似问题有一个编写良好的解决方案的线程,但不幸的是我无法在这里应用它。我知道有很多变量可能导致这种情况所以如果你想让数据库看看
(只有样本数据,如果有的话),请告诉我。我不知道怎么会在这里发布。

I have referred to the a thread that had a well-written solution for a similar problem but unfortunately I couldn't apply it here. I know there are many variables that may be causing this so please let me know if you would like the database to take a look (there is only sample data, if any at all). I don't know how I would post it here though.

谢谢!

推荐答案

好的,这里你去。

Okay, here you go.

主窗体的记录源不应该有子窗体使用的表,子窗体的记录源不应该有相同的表这是主要表格的记录来源。 子表单应该只有子表单存储
数据的表格。 

The main form's record source should not have the table that the subform uses and the subform's record source should not have the same table that is in the main form's record source.  The subform should only have the table that the subform is storing data into. 

两个表单的记录源中不应该只包含控件的查找表 可以使用组合框或列表框显示该值,它们的行源将包含那些查找表,但不包含表单本身。

Both forms should not have any tables in their record sources that are just lookup tables for a control  The value can be displayed using a combo box or list box and their row source would have those lookup tables, but not the form itself.

此外,您需要确保PK字段适用表格的一部分是适用表格记录来源的一部分。

Also, you need to make sure that the PK field of the applicable table is part of the applicable form's record source.


这篇关于“无法添加记录;表___的连接键不在记录集中“错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆