数据输入表单 - 索引/主键空值 [英] Data Entry Form - Index/Primary key null value

查看:67
本文介绍了数据输入表单 - 索引/主键空值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一张表格可以为培训课程创建新记录。该表单基于一个表,该表具有设置为主键的4个键。


表单上的第一个组合框允许选择课程POP代码,然后填写课程模块代码和说明的2个列表框中的详细信息。然后可以从另一个组合框中选择课程部分(按第一个组合框中的值过滤)。最后,手动输入课程会话名称。这4个是主键。 (POPCode,ModuleCode,Section,Session)。


培训师等的更多细节也以类似的方式填写。


当表单上的所有控件都已满(我确保它们符合参照完整性规则)时,我仍然会得到索引/主键不能包含空值。信息。我不明白为什么所有控件都将控件源设置为基础表,并且所有控件都指定了值。任何帮助表示赞赏...

谢谢

I have a form to create a new record for a training course. The form is based on one table that has 4 keys set to primary key.

The first combo box on the form allows selection of the course POP code and this then fills details on 2 list boxs for course module code and description. The course section can then be selected from another combo box (filtered by the value in the first combo box) . Finally the course session name is entered manually. These 4 make a primary key. (POPCode, ModuleCode, Section, Session).

Further details of trainer etc are also filled in a similar manner.

When all of the controls on the form are full (I have ensured they meet referential integrity rules) i still get an "Index/Primary key cannot contain null value" message. I do not understand why as all of the controls have control sources set to the underlying table adn all have a value assigned. Any help is appreciated...
Thanks

推荐答案

我不能确定因为我从未设置过表格有四个主键,但我想Access有一些问题。为什么不直接添加一个键''ID''设置为自动编号并使其成为主键。


I can''t be sure because I''ve never set up a table with four primary keys but I imagine Access is having some problems with it. Why not just add a key ''ID'' set to autonumber and make it the primary key.




I有一个表格来创建培训课程的新记录。该表单基于一个表,该表具有设置为主键的4个键。


表单上的第一个组合框允许选择课程POP代码,然后填写课程模块代码和说明的2个列表框中的详细信息。然后可以从另一个组合框中选择课程部分(按第一个组合框中的值过滤)。最后,手动输入课程会话名称。这4个是主键。 (POPCode,ModuleCode,Section,Session)。


培训师等的更多细节也以类似的方式填写。


当表单上的所有控件都已满(我确保它们符合参照完整性规则)时,我仍然会得到索引/主键不能包含空值。信息。我不明白为什么所有控件都将控件源设置为基础表,并且所有控件都指定了值。任何帮助表示赞赏...

谢谢
I have a form to create a new record for a training course. The form is based on one table that has 4 keys set to primary key.

The first combo box on the form allows selection of the course POP code and this then fills details on 2 list boxs for course module code and description. The course section can then be selected from another combo box (filtered by the value in the first combo box) . Finally the course session name is entered manually. These 4 make a primary key. (POPCode, ModuleCode, Section, Session).

Further details of trainer etc are also filled in a similar manner.

When all of the controls on the form are full (I have ensured they meet referential integrity rules) i still get an "Index/Primary key cannot contain null value" message. I do not understand why as all of the controls have control sources set to the underlying table adn all have a value assigned. Any help is appreciated...
Thanks


顺便说一下,如果那样,你仍然可以将其他键设置为必需的是你担心的,但他们不应该成为主键的一部分。


By the way you can still set the other keys to required if that''s what you''re worried about but they shouldn''t need to be part of the primary key.




我不能肯定,因为我从来没有设置一个包含四个主键的表,但我想Access正在遇到一些问题。为什么不直接添加一个键''ID''设置为自动编号并使其成为主键。
I can''t be sure because I''ve never set up a table with four primary keys but I imagine Access is having some problems with it. Why not just add a key ''ID'' set to autonumber and make it the primary key.


谢谢,

如果不需要它,只需1个主键即可正常工作。

欢呼
thanks,
true that it was not needed, it works fine with just 1 primary key.
cheers


这篇关于数据输入表单 - 索引/主键空值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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