将Subdatasheet tbl链接到另一个tbl的2列 [英] Link Subdatasheet tbl to 2 columns of another tbl

查看:77
本文介绍了将Subdatasheet tbl链接到另一个tbl的2列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Access 2007中,我创建了一个包含两个子字段(生产和分发(主要tblClients中的两列))的表(公司)。然而,如果生产和分销字段中的值完全相同,则tblCompanies的子数据表仅显示来自tblClients的信息。

是否可以在子数据表中显示两者?意思是如果涉及两个不同的公司,它将在公司A以及公司B显示客户信息(因此可能在子数据表中有两次相同的记录)。


提前感谢Margie

解决方案

您在谈论子表单吗?如果是这样,我认为您需要更具体地说明子窗体如何链接到主窗体,以及如何在数据库中链接表格。


我的猜测(有这么少的明确信息)是你需要有单独的子项(子表单,无论如何)来处理两个不同的链接,而不是试图以看似不合逻辑的方式链接它们。



在Access 2007中,我创建了一个包含两个子字段(生产和分发(主要tblClients中的两列))的表(公司)。然而,如果生产和分销字段中的值完全相同,则tblCompanies的子数据表仅显示来自tblClients的信息。

是否可以在子数据表中显示两者?意思是如果涉及两个不同的公司,它将在公司A以及公司B显示客户信息(因此可能在子数据表中有两次相同的记录)。


提前感谢Margie



你的问题有点朦胧,但如果我正确解释它,我可以告诉你,你一次只能给出一个给定表的1个子数据表视图但一切都没有丢失。您还可以通过以下方式获得相同表数据的不同子数据表视图:

  1. 根据表中包含的所有字段创建查询。
  2. 在数据表视图中打开查询。
  3. 插入。
  4. 子数据表。
  5. 选择备用子表。
  6. 输入值链接子字段。
  7. 输入链接主字段的值。

删除子数据表:

  1. 在数据表视图中打开查询。
  2. 格式。
  3. 子数据表。
  4. 删除。


为了防止发布巨大的帖子,我看起来已经留下了太多的信息。我会尝试你的建议ADezii,但首先看这篇文章,看看我们(和NeoPa)是否在同一条轨道上。


我有一张主表:客户

在主表的周围,我构建了一个表单:Clientview

您在表单中输入的信息取自(但如果信息不存在,也可以放入)其他几个表。在表格中,例如公司有两个字段(生产和分销)。具体信息来自公司表。现在Access自动在表公司中创建了一个子数据表,显示了主表客户端的所有信息。

问题是子数据表只显示2个字段(生产和分销)的信息完全相同。

- 示例1:

生产字段中的值:Microsoft

分配字段中的值:Microsoft

- >在表格公司中你看看微软记录的子数据表,你可以看到主表中的所有客户信息客户端


- 示例2:

生产字段中的值:Microsoft

分配字段中的值:TheScripts

- >在公司表中,如果你看一下记录微软或记录TheScripts的子数据表,它根本不会显示任何客户信息。


如果我看一下Insert Subdatasheet表公司,它显示2件事。

- 表公司有:

链接儿童字段:公司

链接主字段:公司

- 表客户有:

链接子字段:生产;分发

链接主字段:公司;公司


我想要的是客户信息显示在记录Microsoft,但也记录在TheScripts。至于最佳解决方案,如果它意味着构建一个新的重组数据库,我没有问题。这是学习过程的一部分。我希望通过这篇文章让我更容易理解。 :)

In Access 2007, I''ve created a table (Companies) with two Child Fields (Production & Distribution (both columns in the main tblClients)). The Subdatasheet of tblCompanies however only shows the info from the tblClients if the values in the Production and Distribution fields are exactly the same.
Is it possible to have both shown in the Subdatasheet? Meaning if two different companies were involved, it will show the Client info at company A but also at company B (thus potentially having the same record twice in the Subdatasheet).

Thanks in advance Margie

解决方案

Are you talking about a subform? If so, I think you need to be a little more specific about how the subform is linked to the main form, and how the tables are linked in the database too.

My guess (with so little clear info) is that you would need to have separate sub-items (subform whatever) to handle the two distinct links rather than trying to link them in what seems an illogical way.


In Access 2007, I''ve created a table (Companies) with two Child Fields (Production & Distribution (both columns in the main tblClients)). The Subdatasheet of tblCompanies however only shows the info from the tblClients if the values in the Production and Distribution fields are exactly the same.
Is it possible to have both shown in the Subdatasheet? Meaning if two different companies were involved, it will show the Client info at company A but also at company B (thus potentially having the same record twice in the Subdatasheet).

Thanks in advance Margie

Your question is a little hazy, but if I interpret it correctly, I can tell you that you can only have 1 Subdatasheet View for a given Table at a time, but all is not lost. You can also have a different Subdatasheet View of the same Table data by:

  1. Create a Query based on all Fields contained in the Table.
  2. Open the Query in Datasheet View.
  3. Insert.
  4. Subdatasheet.
  5. Select the alternate Child Table.
  6. Enter a value for Link Child Fields.
  7. Enter a value for Link Master Fields.

To Remove a Subdatasheet:

  1. Open Query in Datasheet View.
  2. Format.
  3. Subdatasheet.
  4. Remove.


To prevent a huge post, it appears I have left too much info out. I will try your suggestion ADezii, but first this post to see if we (and NeoPa) are on the same track.

I have a main table: Clients
Around the main table I build a form: Clientview
The info you enter in the form is taken from (but can also put into if info doesn''t exist) several other tables. In the form there are for instance 2 fields for companies (Production & Distribution). This specific info comes from the table Companies. Now Access automatically created a subdatasheet in the table Companies which shows all the info from the main table Clients.
The problem is that the subdatasheet only shows the info if the 2 fields (Production & Distribution) are exactly the same.
- Example 1:
the value in the Production field: Microsoft
the value in the Distribution field: Microsoft
-> in the table companies you look at the subdatasheet of the record Microsoft and you can see all the client info from the main table Clients

- Example 2:
the value in the Production field: Microsoft
the value in the Distribution field: TheScripts
-> in the table companies if you look at the subdatasheet of either the record Microsoft or the record TheScripts, it doesn''t show any Client info at all.

If I look at Insert Subdatasheet of the table Companies, it shows 2 things.
- The table Companies has:
Link Child Fields: Companies
Link Master Fields: Companies
- The table Clients has:
Link Child Fields: Production;Distribution
Link Master Fields: Companies;Companies

What I would like is for the client info to be shown at the record Microsoft but also at the record TheScripts. As for the ''best'' solution, if it means building a new reorganized database, I have no problem with that. It''s part of the learning process. I hope I made it all more understandable with this post. :)


这篇关于将Subdatasheet tbl链接到另一个tbl的2列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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