预备和预先正常化 [英] Prepopulation & Normalization

查看:95
本文介绍了预备和预先正常化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我有3个表:客户端,问题和答案。每个都有一个PK AutoID。关系是:tblAnswer(PK AnswerID,FK ClientID,FK QuestionID)然后是Answer字段。现在这里是问题所在。我正在尝试创建一个表单,允许我将特定答案链接到特定的questionID。我将最终有这个1表格的多个表格。 (每个客户有大约1000个问题要回答(所有货币);每个questionID都有一个特定的答案)。现在我已经创建了一个表单但是我无法获得与questionID字段匹配的答案字段。我在表单中添加了大约30个答案字段,(希望有1个问题?1个答案),但我只得到30个与同一字段相关的答案框。因此,当我在其中一个框中输入数字时,所有其他框都显示相同的数字。这不是我需要的。我需要将答案与问题ID相关联。所以30个答案框,每个都与一个问题有关。我绝对没有运气搞清楚这一点。请帮助!!!

解决方案

本能地,我会说客户有很多问题,只有一个答案。


因此


tblClient {ClientID(PK)等}}

tblQuestion {QuestionID(PK),ClientID(FK)等}}
tblAnswer {AnswerID(PK),QuestionID(FK)等。}


答案不应与问题和客户联系,因为问题已经与客户关系密切只是混淆了这个问题。


以下查询应该导致所有客户,每个客户的所有问题和每个问题的所有答案。

展开 | 选择 | < span class =codeLinkonclick =WordWrap(this);> Wr ap | 行号


< BLOCKQUOTE>确定。我已经按照这个并有一个查询显示相同的SQL。但是如何使用它来帮助通过表单输入数据呢?我需要设置一些表格,以便让我为所有客户提出问题的答案。谢谢。



好​​的。我已经按照这个并有一个查询显示相同的SQL。但是如何使用它来帮助通过表单输入数据呢?我需要设置一些表格,以便让我为所有客户提出问题的答案。谢谢。



好​​的,这只是为了让结构正确。


现在创建一个基于客户端表的表单。


根据问答表创建一个查询。


例如

展开 | 选择 < span class =codeDivider> | Wrap | 行号


Hi,

I have 3 tables: Client, Question, and Answer. Each has a PK AutoID. The relationships are: tblAnswer (PK AnswerID, FK ClientID, FK QuestionID) then an Answer field. Now here?s the issue. I am trying to create a form which will allow me to link a specific answer to a specific questionID. I will end up having multiple forms based off this 1 table. (There are about 1000 questions to answer per client (all currency); each questionID will have a specific answer). Now I have created a form but I cannot get the answer field to match to the questionID field. I added about 30 answer fields to the form, (hoping for a 1 question ? 1 answer deal) but I simply get 30 answer boxes that relate to the same field. So when I enter a number in 1 of the boxes, all the other boxes show the same number. This is not what I need. I need for the answers to be linked to the question Id. So 30 answers boxes, each relates to a single question. I am having absolutely no luck figuring this out. PLEASE HELP!!!

解决方案

Instinctively I would say that a Client has many questions and questions have only one answer.

Therefore

tblClient {ClientID (PK), etc.}
tblQuestion {QuestionID (PK), ClientID (FK), etc.}
tblAnswer {AnswerID (PK), QuestionID (FK), etc.}

Answer should not be tied to question and client as question is already tied to client and this just confuses the issue.

The following query should result in All Clients, All Questions for each client and All Answers per question.

Expand|Select|Wrap|Line Numbers


Ok. I''ve followed this and have a query which shows the same sql. But how do I use that to help with data entry though forms? I need to set up some forms to allow me to have an answer for a question for all clients. Thanks.


Ok. I''ve followed this and have a query which shows the same sql. But how do I use that to help with data entry though forms? I need to set up some forms to allow me to have an answer for a question for all clients. Thanks.

Ok this was just to get the structure right.

Now create a form based on Client Table.

Create a query based on Question and Answer Table.

e.g.

Expand|Select|Wrap|Line Numbers


这篇关于预备和预先正常化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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