汽车。以表格形式显示表记录 [英] Auto. display of table record in form

查看:84
本文介绍了汽车。以表格形式显示表记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好


我有一个表PRODUCT NAMES,字段为PRODUCTNAME和COMMODITY,另一个表名为COMMODITY NAMES,只有字段商品(包含7种不同商品的清单),以及名为ENGINEERING的表单,带有两个单独的组合框(PRODUCTNAME和COMMODITY),用户必须从已填写的PRODUCT NAMES表中选择一个产品,该表显示为options。


我需要表单中的COMMODITY组合框自动在PRODUCT NAMES表中显示其相关PRODUCTNAME的值。如果该特定产品没有已经指定的产品,则用户可以从组合框列表中选择商品(行源是COMMODITY NAMES表上的COMMODITIES字段)。


我该怎么做?或者


是否有可能或者更好地删除商品名表,以便最初每个产品都必须填写相应的商品?


谢谢,

Gilberto

Hello

I have a table PRODUCT NAMES with fields PRODUCTNAME and COMMODITY, another table called COMMODITY NAMES with the only field COMMODITIES (containing a list of 7 different commodities), and a form called ENGINEERING with TWO separate combo boxes (PRODUCTNAME and COMMODITY) where the user has to select a product from the already filled in PRODUCT NAMES table which are displayed as "options".

I need the COMMODITY combo box in the form to automatically display the value of its related PRODUCTNAME in the PRODUCT NAMES table. And if that specific product doesnt have an already specified one, that the user could select the commodity from the combo box list (which "row source" is the COMMODITIES field on the COMMODITY NAMES table).

How can i do this? or

Is it possible or is it better to delete the COMMODITY NAMES table out of the question so that initially EVERY product has to have their corresponding commodity filled in?

Thanks,
Gilberto

推荐答案

商品和产品之间关系的本质是什么?


您正在寻找一对一,一对多或多对多......问自己一个商品有多个产品的问题吗?一种产品可以有多种商品吗?


如果一种产品只有一种商品,而一种商品只与一种产品相关联,那么你就会有一对一的关系,它会可以将两个表结合起来。


如果一种产品可以有多种商品,或者一种商品可以与多种产品相关(我怀疑是这种情况),那么你就有一对一,因此需要第二个表格。


如果一个产品可以与多种商品相关并且一种商品可以与多种商品相关,那么您就有多对多的关系,因此需要第三种商品然后,在商品表上,通常的做法是放置一个名为CommodityID的第二个字段,并使用此字段作为主键,为其提供自动编号值。在您的组合框中,您可以在行源中引用它,如下所示:SELECT CommodityID,Commodity From Commodities。


创建一个查询,提取要在表单上显示的值,然后绑定你的各种控件来更新查询传递的字段。


如有任何问题,请不要犹豫!


问候,

Scott
What is the nature of the relationship between Commodities and Products?

You are looking for One To One, One To Many or Many to Many... Ask yourself questions like can one commodity have more than one product? Can one product have more than one commodity?

If one product will only have one commodity and one commodity will only be associated with one product then you have a one to one relationship and it will be all right to combine the two tables.

If one product can have more than one commodity, or one commodity can be related to more than one product (which I suspect is the case) you have a one to many and therefore need the second table.

If one product can be related to more than one commodity AND one commodity can be related to more than one product you have a many to many relationship and therefore need a third, linking, table.

Now then, on your commodities table, normal practice is to place a second field named CommodityID and use this field as the primary key, giving it an autonumber value. In your combo box you reference this in the row source like this: SELECT CommodityID, Commodity From Commodities.

Create a query that pulls the values you want to show on the form, then bind your various controls to update the fields being passed by the query.

Any questions, don''t hesitate to ask!

Regards,
Scott



商品和产品之间关系的本质是什么?


您正在寻找一对一,一对多或多对多......问自己一个商品有多个产品的问题吗?一种产品可以有多种商品吗?


如果一种产品只有一种商品,而一种商品只与一种产品相关联,那么你就会有一对一的关系,它会可以将两个表结合起来。


如果一种产品可以有多种商品,或者一种商品可以与多种产品相关(我怀疑是这种情况),那么你就有一对一,因此需要第二个表格。


如果一个产品可以与多种商品相关并且一种商品可以与多种商品相关,那么您就有多对多的关系,因此需要第三种商品然后,在商品表上,通常的做法是放置一个名为CommodityID的第二个字段,并使用此字段作为主键,为其提供自动编号值。在您的组合框中,您可以在行源中引用它,如下所示:SELECT CommodityID,Commodity From Commodities。


创建一个查询,提取要在表单上显示的值,然后绑定你的各种控件来更新查询传递的字段。


如有任何问题,请不要犹豫!


问候,

Scott
What is the nature of the relationship between Commodities and Products?

You are looking for One To One, One To Many or Many to Many... Ask yourself questions like can one commodity have more than one product? Can one product have more than one commodity?

If one product will only have one commodity and one commodity will only be associated with one product then you have a one to one relationship and it will be all right to combine the two tables.

If one product can have more than one commodity, or one commodity can be related to more than one product (which I suspect is the case) you have a one to many and therefore need the second table.

If one product can be related to more than one commodity AND one commodity can be related to more than one product you have a many to many relationship and therefore need a third, linking, table.

Now then, on your commodities table, normal practice is to place a second field named CommodityID and use this field as the primary key, giving it an autonumber value. In your combo box you reference this in the row source like this: SELECT CommodityID, Commodity From Commodities.

Create a query that pulls the values you want to show on the form, then bind your various controls to update the fields being passed by the query.

Any questions, don''t hesitate to ask!

Regards,
Scott



Scott,谢谢你的回复。


正如你想的那样1商品可以分配给多个产品,但产品只能有一种商品。我已经有两个相关的表(商品和工程)和我的COMMODITY组合框(在工程表格中)我已经有:


Scott, thank you for your reply.

As you supposed 1 commodity can be asigned to more than one product but a product can have ONLY one commodity. I already have the two tables related (COMMODITIES and ENGINEERING) and on my COMMODITY combo box (in the ENGINEERING FORM) i already have:

展开 | 选择 | Wrap | 行号


你有没有试过这样的东西?


在你的组合框的RowSource中产品:
Have you tried something like this?

In the RowSource for your combo box Products:
展开 | 选择 | Wrap | 行号


这篇关于汽车。以表格形式显示表记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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