搜索特定记录 [英] searching a specific record

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

问题描述

大家好。我已经在这个数据库工作了很长一段时间,仍然无法想办法做我想做的事情。它是一个跟踪图纸和工程变更等的数据库。同样,图纸表按年份分组。


我有一个主窗体,在该主窗体上,有几个用于初始化子窗体的cmd按钮。有很多桌子,名字很简单。例如,对于2008年生产的绘图,称为2008绘图。等等。


所以在主窗体上,当我点击搜索绘图时按钮,它假定用户正在搜索2008年当前年份的绘图。因此,它会显示我为2008绘图创建的表单。在这个表格上,有很多与图纸有关的数据:图纸编号,标题,人员,年份等。


另外,还有两个名为退出的CMD按钮;退出当前表格并返回主表格并搜索查询数据。


我希望能够做的是提示用户输入图号。它与图号相关联。 2008绘图栏目表。当我按下搜索按钮时按钮,我希望它获得绘图编号用户输入并查询我基于表2008绘图创建的查询。查询完成后,我想以2008绘图的形式填充数据。只有一条记录,因为所有图纸编号都是唯一的。


这是我做过的,不幸的是没有用。


-------------------------------------- ----------

Hello everyone. I have been working on this DB for quite some time and still can''t figure out a way to do what I want to do. It''s a database that keep track of drawings and engineering change etc. Aslo, the tables for drawings are grouped by year.

I have a Main Form and on that main form, several cmd buttons to initialize sub forms are located. There are a quite a few tables and the names are quite simple. For example, for drawing that are produced in 2008 are called "2008 Drawing" and so on.

So on the main form, when I click on "Search Drawing" button, it assumes that the user is searching for the drawing in the current year which is 2008. Therefore, it brings up the form I created for "2008 Drawing". On this form, there are a lot of data related to the drawing: Drawing Number, Title, Draft Person, Year, etc.

Also, there are two CMD buttons called "Exit" which exits the current form and go back to the Main Form and "Search" which queries the data.

What I want to be able to do is to prompt the user to enter the "Drawing Number" which is bound to "Drawing Number" column of the "2008 Drawing" table. When I press the "Search" button, I want it to get the "Drawing Number" that users entered and query the query I created base on table "2008 Drawing". When the query is done, I want to populate the data back in the form "2008 Drawing". There will be only one record because all the drawing numbers are unique.

This is what I did and did not work unfortunately.

------------------------------------------------

展开 | 选择 | Wrap | 行号

推荐答案

我的不好。我才意识到我提供了错误的信息。 年是指年。字段未绑定,并且不是下拉字段。名单。它只是一个输入int的字段。
My bad. I just realized that I gave the wrong information. The "Year" field is unbound and it is not a "drop down" list. It''s just a field to enter int.


一些想法:
  1. 不要存储你的多年来在单独表格中的数据。只需在单个表中有一个[Year]字段即可分隔出不同的年份。这将使您的数据库设计变得更加复杂。
  2. 让我们知道代码失败的行号以及错误的详细信息。


我添加了一些代码来制作年份。田野工作。如果我将年份作为表中的一列,那将会更简单。我只是不想从头开始创造一切。我的嘘声给了我自1999年以来一直使用的MS Access DB,它没有任何形式。他们分别绘制每张图纸的唯一方法是通过拼写绘图类型和绘图类型。和年。有很多桌子。他们分开的方式很简单。如果附图或示意图是电气图,则并且年份是2008,他们称之为2008电气图。如果是机械的,他们会以相同的方式命名。所以这是很多桌子和太多的记录和东西。


我做的是我创建了一个实地调用年。并根据输入的年份打开查询。
I added a few codes to make "Year" field works. It''s ture that if I have year as a column in the table, it will make it simpler. I just don''t want to start creating everything from ground up. My boos gave me the MS Access DB they have been using since 1999 which doesn''t have any sort of form. The only way for them to seperate each drawing is by spearating "Type of Drawing" and "Year". There are a lot of tables. They way they separate is sort of simple. If the drawing or schematic is "Electrical Drawing" and the year is "2008", they call the table "2008 Electrical Drawing". If it is mechanical, they name it in the same way. So that''s a lot of tables and way too many records and stuff to play with.

What I did was that I created a field call "Year" and open up the query according to the year entered.
展开 | 选择 | Wrap | 行号


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

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