如何使用表单输入和输出来搜索单个表数据库? [英] How do I make a single table database searchable with form input and output?

查看:76
本文介绍了如何使用表单输入和输出来搜索单个表数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,这是交易。我在阿富汗,试图为我的飞行员创建一个Access数据库,以便在他们从任务中回来时进行汇报。包括的字段将是名称,任务,时间等等。我们目前有一个Access数据库,已经从一个单元到另一个单元格式化。这个数据库的问题是它非常混乱,没有组织,数据库的一半原始功能不再起作用。所以上周我开始从头开始创建一个新的数据库。


在上周之前,我从未接触过生命中的Access。这就是我的问题所在。


我花了无数个小时来构建这个新的数据库,学习Access的来龙去脉,并搜索试图找到问题答案的论坛。截至目前,数据库的基本功能正常工作。数据可以输入到我创建的表单中,并存储在数据库后端。这是关于它能做什么的程度。


我需要完成的是有一个表格可以用来搜索日期范围的数据库的特定字段,谁飞行任务,任务是什么等等,然后将这些结果返回到在表格上打开的数据库的简化版本。 (这在当前版本中有效,我对如何操作有一般的想法,但它不起作用)打开的切碎数据库需要有一个链接,显示原始表单,其中包含所有相应的数据。适当的领域。就像我说的那样,旧的数据库确实很好,而且工作正常...我的不行。


更重要的是,我需要能够将数据导出到其他程序。某些数据需要制作图表,其他数据部分将在Excel文档中创建数据库的简化版本,并提供所需信息。我甚至不知道从哪里开始。


好​​的,这是我的数据库设置方式:

- 1存储数据表(tblDebrief)

- 1用于将数据输入到该表中的表单(frmDebrief)

- 10对应于表单上用于输入数据的组合框的表(来源:AO,来源:使命,来源:团队等)

- 4个表单,用于获取数据以提供我需要的答案(frmSearch,frmExport,frmView)

- 1个配置板,其中包含指向所有表单的链接(这实际上几乎完美无缺) ,所有表格链接回交换机,是的!唯一的问题是,当我将交换机设置为弹出时,我实际上不可能回到交换机的设计视图中)


我意识到'很多人会相信我会在这台电脑上等待回复和任何帮助,直到我得到这个该死的东西固定。


我要求的主要内容是基本英语的回复。是的,我可以理解像表格,表格,查询这样的术语,而且我对当天的VB编程有一点了解,但是你开始用全部技术语言进行交谈,我迷失了。如果有帖子,任何人都知道这可以帮助我正在寻找什么,请发布它。我已做好充分的准备并愿意挖掘任何可能有用的东西。我不是要求任何人为我创建这个数据库,请指出我正确的方向,因为现在我很失落!

Ok here''s the deal. I''m in Afghanistan and attempting to create an Access database for my pilot''s to debrief on when they come back from a mission. Included fields would be things like names, mission, time, etc. etc. We currently have an Access database that has been grandfathered down from unit to unit that kind of works. The issue with this database is that it is incredibly messy, unorganized, and half of the original functions of the database don''t work anymore. So last week I started making a new database from scratch.

Prior to last week I''d never touched Access in my life. Therein lies my problem.

I''ve spent countless hours building this new database, learning the ins and outs of Access, and scouring forums trying to find the answers to my problems. As of right now the basic function of the database works. Data can be input to the form I created and is stored on the database back end. That''s about the extent of what it can do.

What I need to accomplish is having a form that I can use to search specific fields of the database for date ranges, who was flying that mission, what the mission was etc. and then return those results in a chopped down version of the database that opens on the form. (this works in the current version, and I have the general idea of how to do it, but it''s not working) The chopped database that opens needs to have a link that displays the original form with all the appropriate data in the appropriate fields. Like I said, the old database does exaclty this and it works fine... mine doesn''t.

More importantly I need to be able to export the data to other programs. Certain data will need to make graphs, other parts of data will create a chopped down version of the database in an Excel doc with the information needed. I don''t even know where to begin here.

Ok, here is how my database is set up:
- 1 Table for storing data (tblDebrief)
- 1 Form for inputing data into that table (frmDebrief)
- 10 Tables that correspond to combo boxes on the form for inputing the data (Source:AO, Source:Mission, Source:Team, etc.)
- 4 forms for getting the data to provide the answers I need (frmSearch, frmExport, frmView)
- 1 Switchboard with links to all the Forms (this actually works almost perfectly, and all the forms link back to the switchboard, yay! The only issue with this is that when I set the switchboard to "popup" it is physically impossible for me to go back into the design view of the switchboard)

I realize that''s alot to take in Believe me I''ll be at this computer waiting for responses and any help at all until I get this damn thing fixed.

The main thing I''m asking for are responses that are in basic English. Yes, I can understand terms like Forms, Tables, Queries, and I know a little bit about VB programming from back in the day, but you start talking in all out technical language and I''m lost. If there are posts anyone knows of that can help with what I''m looking for please post it. I am fully prepared and willing to dig through anything that can be of use. I''m not asking anyone to make this database for me, just please point me in the right direction because right now I am LOST!

推荐答案

因为这似乎为了史诗般的好事,我不介意花很多时间和你一起看看这个。


对于初学者来说,搜索功能。我看到输入日期范围和多个标准的最佳方法是建立一个动态的在哪里。串。这基本上是使用一些VBA代码来过滤你的数据库在哪里已经选择了某些标准。


最好的例子是由Allen Browne创建的,我将首先将你直接链接到他的网站,然后直接链接到我正在谈论的代码。


他的网站将解释你可以在你的数据库中使用的一些技巧,并且有明确的表达方式,我在8个月前就和你自己一样,现在我觉得我知道足够多的代码/技术让大多数数据库朝着正确的方向发展,我虔诚地使用了Allen的网站:

http://allenbrowne.com/tips.html


现在创建搜索:

http://allenbrowne.com/ser-62.html


如果您遇到任何搜索内容让我知道,我将提供他的代码的缩减示例它多一点(但通常值得尝试自己插上它。)


你提到的第二件事就是能够查看返回搜索的完整信息结果" ;.在您当前的数据库中,您可能会在主表上执行搜索,并返回一些记录,给出简短的概述。那里的所有数据。通常每个返回的记录旁边都会有一个按钮,您可以点击该按钮打开一个带有完整记录的表单。它背后的记录/信息。


如果你正在谈论这个问题,我最近回答了一个话题,一个人问了一些非常类似的东西,我发布了一个你可能能够得到的示例数据库只是为了澄清它是你所追求的功能。线程在这里:

http://bytes.com/topic/access/answer...m-summary-form

如果还有什么需要知道的,只需邮寄再说实话我相信你接下来会有更具体的问题;)


编辑:


很抱歉忽略导出结果到excel等其他程序,我确实有一些代码可以执行此操作,但在您正确找到返回结果的搜索表单之前,现在可能值得用导出保存。
Since this seems to be for an epic good cause I dont mind spending quite a bit of time taking a look at this with you.

For starters the search functionality. The best way I have seen for looking at inputting date ranges and multiple criteria is by building a dynamic "where" string. This is essentially using some VBA code to filter your database down "where" certain criteria have been selected.

The best example of this was created by Allen Browne and I will link you outright to his site first and then directly to the code I am talking about.

His site will explain quite a few tricks you will be able to utilise in your database with clear explenations, I was in a similar boat to yourself just 8 months ago and now I feel I know a decent enough amount of code/techniques to get most databases going in the right direction and I used Allen''s site religiously:

http://allenbrowne.com/tips.html

Now to the creation of the search:

http://allenbrowne.com/ser-62.html

If you get stuck with any of the search stuff let me know and I will provide a cut down example of his code to get your head around it a bit more (but it is often worth trying to plug away at this yourself.)

The second thing you mentioned was pretty much "being able to view full information of returned search results". In your current database it is likely you perform a search on the main table and you are returned a number of records giving a brief "overview" of all the data that is there. Usually there will be a button beside each of the returned records which you can click to open up a form with the "full" record/information behind it.

If this is what you are talking about, I recently answered a topic where a guy asked something very similar and I posted an example database which you might be able to view just to clarify it is the functionality you are after. The thread is here:

http://bytes.com/topic/access/answer...m-summary-form

If there is anything else you need to know just post again and to be honest I am sure you will have more specific questions next ;)




Sorry for ignoring the exporting results to other programs such as excel etc, I do have some code that will do this but until you have the search form returning results as you want correctly then it might be worth holding fire with the exporting for now.


Munkee,


非常感谢您的回答。我现在正在挖掘这些网站,他们肯定在帮忙。对于初学者来说,我意识到我没有任何其他形式链接到主表,它们都只是浮动而没有任何可供参考。


我会在有机会实施所有变更之后明天发布更新,看看我当时在哪里。

再次感谢,我真的很感激!
Munkee,

Thank you so much for the answer. I''m digging around through those sites now and they are definitely helping. For starters, I realized I didn''t have any of my other forms linking to the main table, they were all just floating around with nothing to reference to.

I''ll post an update tomorrow after I''ve had a chance to implement all the changes and see where I''m at then.

Thanks again, I really appreciate it!


没问题。


艾伦使用的方法是将搜索选项放入表单标题。


我使用稍微不同的设置,我创建一个子表单,其中记录源设置为查询我要搜索的表。表单样式为连续。然后,我在该子表单上放置文本框,以便在更多的概述中容纳基础表的字段。样式,因此并非所有字段都用文本框表示。


然后我在此设置旁边添加了一个带有文本view的按钮。在上面。这将在点击时打开一个表单,其中包含完整信息的整个记录​​。


我的搜索表单包含此子表单,我将搜索框/选项等放在此主表单上形式和一个简单的搜索按钮。


为了说明所有这一切更清楚,我附上了一些文件,其中有一些屏幕截图和基本的解释为什么/如何。


基于表格或表格的连续子表单query.zip


这篇关于如何使用表单输入和输出来搜索单个表数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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