允许输入空或空字段

允许输入空或空字段

本文介绍了允许输入空或空字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个库存软件,ms-access 2003作为后端,vb 6.0作为前端。有两个表名为Supplier(SupplierID,Name,Address,Phone NO)和Item(ItemCode,ItemName,SupplierID,Category,Price)。 SupplierID是Supplier表中的主键和Item表中的外键。我已经建立了这两个表格和强制参照完整性之间的关系。

但是ItemID表中的SupplierID是可选的。并且其属性Required设置为NO,并且允许在两个表中将零长度设置为yes。

当我尝试将SupplerId留空或使用vb代码将其设置为null时,在ItemForm中输入信息

发生错误您无法添加或更改记录因为表格供应商需要相关记录


我要求用户以项目形式填写有关供应商的信息,如果他希望但不是它必须

如何解决这个问题。


我需要紧急帮助。请................

解决方案



谢谢Delerna


关系类型是一对多。



I am developing a software on inventory with ms-access 2003 as backend and vb 6.0 as front end. There are two tables named Supplier(SupplierID, Name, Address, Phone NO) and Item(ItemCode, ItemName, SupplierID, Category, Price). SupplierID is primary Key in Supplier table and foreign key in Item table. I have established relationship between these two tabled and enforced referential integrity.
But SupplierID is optional in Item table. and its properties Required is set to NO and allow zero length is set to yes in both the tables.
when i try to leave the SupplerId empty or set it to null using vb code , while entering information in ItemForm
an error occured "you cannot add or change a record because a related record is required in table Supplier"

I require that a user may fill the information about supplier in item form if he
wishes but not made it compulsory
How can i solve this problem.

I need an urgent help. Please................

解决方案


Thanks Delerna

Relationship type is one-to many.



这篇关于允许输入空或空字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 03:23