查找包含1个以上主键的记录 [英] Find a record with more than 1 primary key

查看:54
本文介绍了查找包含1个以上主键的记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好。


我正在使用表单在我的一个表中查找记录。该表有3个主键,并没有正确提取记录。


Form1绑定到Table1(Customers和CustomerID列表)ComboBox1查找客户。

展开 | 选择 | Wrap | 行号

解决方案

问题是否真的很明显,我只是没有得到它?或者没有人知道如何做到这一点?


我希望这是因为你的问题很难理解。当我看到有关多个主键的内容时,我知道这会很复杂。我们所有想要回答问题的人都知道多种PK是不可能的。一般来说,留下三天的问题强烈表明它很难理解。 95%的运气参与获得答案,根本不是运气,而是提出问题的方式。


因为你的描述包括我的内容所以我更加困惑对表1的引用,而发布的SQL引用[tblCustomers]& [tblCustReq]。我努力奋斗但是当我走到尽头时,我发现我理解得很少,并且无法提供任何指导。如果我是第一个达到这一点的人,我会感到惊讶。


我必须同意NeoPa的意见。你的问题有点难以理解。这是我对你的问题的最佳解释:


首先,正如NeoPa所提到的那样,你不能拥有3个主键,所以我猜你的主键是这三个领域的综合体。


至于你的表格听起来你应该有这样的东西:


- 一个基于查询的表格,由combobox1过滤。

- 基于由combobox2过滤的查询的子表单。此子表单的默认视图应设置为连续。


只要您在表单之间拥有正确的父/子关系,您就不需要一堆代码。

Hi All.

I am working with a form to lookup records in one of my tables. The table has 3 primary keys and is not pulling up the records correctly.

Form1 is bound to Table1 (a list of Customers and CustomerID''s) ComboBox1 looks up the Customer.

Expand|Select|Wrap|Line Numbers

解决方案

Is the problem really obvious and I''m just not getting it? Or does no one know how to do this?


I expect this is because your question is so hard to understand. I knew it would be complicated when I saw the bit about multiple Primary Keys. All of us looking to answer questions know that multple PKs is not possible. Generally, a question left for three days is a strong indication that it''s difficult to understand. 95% of the luck involved in getting answers, isn''t luck at all, but is how the question is presented.

I was further confused when I read on because your description includes a reference to Table1, whereas the SQLs posted refer to [tblCustomers] & [tblCustReq]. I struggled on but when I got to the end I found I understood very little and wasn''t in a position to offer any guidance. I''d be surprised if I were the first one to get to that point.


I''ll have to agree with NeoPa on that one. Your question is a bit hard to understand. Here''s my best interpretation of what you problem is:

For starters, as NeoPa mentions, you can''t have 3 primary keys so I''m guessing your primary key is a composite of these three fields.

As for your forms it sounds like you should have something like this:

- A form based on query that is filtered by combobox1.
- A subform that is based on a query that is filtered by combobox2. The default view of this subform should be set to continuous.

As longs as you have the correct parent/child relationships between the forms you really don''t need a bunch of code.


这篇关于查找包含1个以上主键的记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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