记录表格/表格的存在 [英] Record Existance Across Forms/Tables

查看:113
本文介绍了记录表格/表格的存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个庞大的数据库,我必须分成两个表(我通常会使用一个,但它会达到表中最大数量的项目)。我构建了用于数据输入的输入表单,它们被类似地分割(用户需要点击转到第2部分按钮)。


过去当我用过一张桌子时,我只包括:

DoCmd.OpenForm stDocName ,,, stLinkCriteria

并且工作正常。


但是现在数据跨越两个表,我需要

1)检查是否有记录已经存在于第二个表格/表格中的主键[主题编号],如果是,打开它,或者

2)在[第二个表格]中创建一个新记录并拥有它唯一的[主题编号]等于第一个表格/表格的[主题编号]以保持一致。


我知道这里肯定有一些我不想要的东西。我很擅长(正如你所知道的那样),所以我非常感谢任何人帮忙。

I have a gigantic database that I had to split across two tables (I''d normally use one, but it hits the max number of items in a table). I built input forms for data entry, which are similarly split (the user needs to hit a "go on to part 2" button).

In the past when I''ve used one table for everything, I just include:
DoCmd.OpenForm stDocName, , , stLinkCriteria
and that works fine.

But now that the data is across two tables, I need to
1) check to see if a record is already in existance by a primary key [Subject Number] in the second form/table, and if so, open it, or
2) create a new record in the [Second Table] and have its unique [Subject Number] equal the [Subject Number] of the first form/table to keep things consistent.

I know there must be something I''m missing here. I''m pretty new at this (as you can tell), so I would greatly appreciate anyone helping out .

推荐答案

你的表元数据是什么样的?


这是一个如何发布表元数据的例子:

表名= tblStudent
What does your table metadata look like?

Here is an example of how to post table MetaData :
Table Name=tblStudent
展开 | 选择 | Wrap | 行号


谢谢Price先生。


我按照你的要求阅读了这篇文章。我相信我的问题是我不知道如何分解数据。基本上,数据库需要记录问卷。每个用户都由一个唯一标识符匿名定义。


它基本上看起来像这样,但更长:
Thank you, Mr. Price.

I read the article, as you requested. I believe my problem is that I don''t exactly know how to breakup the data. Basically, the database needs to record a questionaire. Each user is anonymously defined by a unique identifier.

It basically looks like this, but much longer:
展开 | 选择 | Wrap | 行号


嗯...


根据您的情况,您是否尝试进入Access的表分析器,看看它的建议是什么,如破坏你的桌子变成小块?这将在MS Access 2003中的Tools-Analyze-Tables下进行。


数据规范化背后的想法是,您只需将一个数据存储在一个物理位置。本教程中提到的规则修改并扩展了这个基本前提。


PK / FK关系的概念是将一个表中的数据与另一个表中的数据相关联。例如,根据您的情况,完成问卷调查的人员是匿名的,但使用唯一的#进行识别。这应该成为你的tblRespondants的PK。下一个表可以包含问题,其中包含字段QuestionID以唯一标识每个问题。第三个表格将链接以上两个,以便将每个RespondidID与每个QuestionID关联。


但是,根据您的情况,当您遇到空间限制时尝试将超过一定数量的条目存储到任何一个表格......解决方案可能是在一个表格中存储基于特定日期范围的历史数据。你存储了多少个条目?有多少是独一无二的(即你有意/无意地复制记录)?


MS Access的大小限制对于大多数应用程序来说相当慷慨:2千兆字节存储了大量数据。每个表可以容纳255个字段...您的表有多少个字段?
Hmm...

With your situation, have you tried going into Access''s table analyzer to see what it recommends as far as breaking your table into smaller pieces? That would be under Tools-Analyze-Tables in MS Access 2003.

The idea behind data normalization is that you should only have to store one piece of data in one physical location. The rules referred to in the tutorial modify and extend this basic premise.

The concept of PK/FK relationships is to relate data in one table to data in another table. For example, with your situation, the people who are completing your questionnaire are anonymous, but identified with a unique #. This should become the PK of your tblRespondants. The next table can include questions, with a field QuestionID to uniquely identify each question. The third table will link the above two in order to ''relate'' each RespondantID with each QuestionID.

With your situation, however, you are going to run into space limitations when you try to store more than a certain number of entries to any one table... The solution may be to store historic data based on a certain date range in one table. How many entries are you storing? How many are unique (i.e. are you duplicating records knowingly/unknowingly)?

The size limits for MS Access are fairly generous for most applications: 2 gigabytes stores a lot of data. Each table can hold 255 fields... How many fields does your table have?


这篇关于记录表格/表格的存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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