处理组合框 [英] Handling Combo Boxes

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

问题描述

我正在为医院开发一个提供门诊账单信息的应用程序。我已经创建了所需的适当表。我必须开发一个客户端服务器系统,从多个系统中,不同的人将数据输入到依赖患者的表格中。所有患者及其访问的详细信息都存储在MSAccess数据库中,并根据请求进行相应检索,并创建报告。

我开始创建表单,我必须创建一个组合框,它提供以下功能:


---当你开始输入名字时,下拉菜单菜单会出现提供选项,包括


< new patient> :选择此选项将带您到新的患者登记表

a您输入的信息名称列表,其中包含数据库中所有患者的姓氏


a您键入的信息包含在所有患者名字中的名称列表


a您输入的字母Soundex的名称列表在Soundex中匹配名字或姓氏



例如,你输入史密斯字样下拉菜单看起来像是:


<新病人>


史密斯,约翰


Blackwell,Smithson


Smythe,Robert



在下拉菜单中选择应该返回自动该患者在患者中的数字指数表格。


如何处理这种类型的dynalic信息,因为根据组合框中用户输入的文本,如果数据库中存在同名患者,则应列出。


我正在对这种功能进行分组,以便用最少的点击次数输入新的患者数据。


如果你能提供的话会很棒对此有一些建议。


谢谢,

Pdesh3。

I am developing an application for a hospital which provides Outpatient billing information. I have created appropriate tables required. I have to develop a client server system where from multiple systems differnt people will enter data into the forms relted to the patients. The details of all the patients and their visits are stored in the MSAccess database and retrieved accordingly upon request and reports will be created.
I started creating forms and I have to create a combo box which provides following functionality:

---when you start typing the name, the drop down menu would appear offering options including

<new patient> : selecting this option would take you to the new patient registration form

a list of names in which the information you typed is contained in the last name of all patients in the database

a list of names in which the information you typed is contained in the first names of all patients

a list of names in which the Soundex of the letters you typed matches in the Soundex of either the first or last names


For example, you type in "Smith" and the drop menu looks something like:

<new patient>

Smith, John

Blackwell, Smithson

Smythe, Robert



Selecting on the drop down menu should return the auto number index of that patient in the "patients" table.

How to handle this kind of dynalic information as depending on the user typed text in combo box the patients with the same name if exist in database should be listed.

I am grouping this kind of functionality so that it will be easy to enter new patients data with minimum clicks.

It would be great if you can provide some suggestions on this .

Thank you,
Pdesh3.

推荐答案

去提出一些问题来解决这个问题。


1st - 组合框有一个固定的选择。行为。您可以开始输入它,然后自动更正。帮助您找到您正在进入的价值的条目。该逻辑仅基于字符匹配。如果你输入A,它会转到以A开头的任何名称。如果你用D跟着它,那么它会转到以AD开头的第一个名字等等。


有人说......你问的是使用组合框真的不可能。


如果您的要求允许,可以使用文本框输入一个按钮可以用来启动你的搜索。


你想要的大部分都很容易。关于史密斯返回smyth的部分,这是一个更多涉及并需要更换字符,以及大量开销猜测的部分。在更换模式时。


告诉我们您希望如何继续。

J
Going to have to ask some questions to get this one going.

1st - Combo boxes have a fixed "selection" behavior. You can start to type in it, and it "auto-corrects" the entry to assist you in finding the value you''re entering. This logic is based solely on a character match. If you type in A, it goes to whatever name begins with A. If you follow it by a D, then it goes to the first name that starts with AD...etc.

That being said...what you''re asking isn''t really possible using a combo box.

If your requirements allow it, a textbox can be used to type in. A button can be used to launch your "search".

Most of what you want is easy enough. The part about smith returning smyth, that''s a little more involved and requires character replacement, and a lot of overhead "guessing" when it comes to replacing patterns.

Let us know how you wish to proceed.
J


这是一篇文章,可以帮助您搜索表单:
http://www.thescripts.com/forum/thread590551.html


添加新记录和所有请求都是可能的问题是你对MS Access有多精明?你知道如何在VBA中进行任何编码吗?
Here is an article to help you with a search form:
http://www.thescripts.com/forum/thread590551.html

Adding a new record and all of your requests are possible the question is how savvy are you with MS Access? Do you know how to do any coding in VBA?



我正在为医院开发一个提供门诊账单信息的应用程序。我已经创建了所需的适当表。我必须开发一个客户端服务器系统,从多个系统中,不同的人将数据输入到依赖患者的表格中。所有患者及其访问的详细信息都存储在MSAccess数据库中,并根据请求进行相应检索,并创建报告。

我开始创建表单,我必须创建一个组合框,它提供以下功能:


---当你开始输入名字时,下拉菜单菜单会出现提供选项,包括


< new patient> :选择此选项将带您到新的患者登记表

a您输入的信息名称列表,其中包含数据库中所有患者的姓氏


a您键入的信息包含在所有患者名字中的名称列表


a您输入的字母Soundex的名称列表在Soundex中匹配名字或姓氏



例如,你输入史密斯字样下拉菜单看起来像是:


<新病人>


史密斯,约翰


Blackwell,Smithson


Smythe,Robert



在下拉菜单中选择应该返回自动该患者在患者中的数字指数表格。


如何处理这种类型的dynalic信息,因为根据组合框中用户输入的文本,如果数据库中存在同名患者,则应列出。


我正在对这种功能进行分组,以便用最少的点击次数输入新的患者数据。


如果你能提供的话会很棒对此有一些建议。


谢谢,

Pdesh3。
I am developing an application for a hospital which provides Outpatient billing information. I have created appropriate tables required. I have to develop a client server system where from multiple systems differnt people will enter data into the forms relted to the patients. The details of all the patients and their visits are stored in the MSAccess database and retrieved accordingly upon request and reports will be created.
I started creating forms and I have to create a combo box which provides following functionality:

---when you start typing the name, the drop down menu would appear offering options including

<new patient> : selecting this option would take you to the new patient registration form

a list of names in which the information you typed is contained in the last name of all patients in the database

a list of names in which the information you typed is contained in the first names of all patients

a list of names in which the Soundex of the letters you typed matches in the Soundex of either the first or last names


For example, you type in "Smith" and the drop menu looks something like:

<new patient>

Smith, John

Blackwell, Smithson

Smythe, Robert



Selecting on the drop down menu should return the auto number index of that patient in the "patients" table.

How to handle this kind of dynalic information as depending on the user typed text in combo box the patients with the same name if exist in database should be listed.

I am grouping this kind of functionality so that it will be easy to enter new patients data with minimum clicks.

It would be great if you can provide some suggestions on this .

Thank you,
Pdesh3.



我相信我解决了问题中最困难的部分 - 基本上是如何根据部分名字和姓氏动态构建组合框的RowSource并在混合中包含某种SoundEx功能?我会发布代码和逻辑,然后让你决定。我的示例数据基于以下内容:


表名:
tblEmployeesPFD
姓氏字段: LastName
名字字段: FirstName
组合框名称: cboNames
列数: 2
< b>绑定列: 1
初始行源类型:表/查询
初始行源: SELECT tblEmployeePFD.LastName,tblEmployeePFD .FirstName FROM tblEmployeePFD Order by tblEmployeePFD.LastName;

I do believe I solved the most difficult part of your question which was basically - How do I dynamically build a RowSource for a Combo Box based on partial First and Last Names and include some sort of SoundEx capability into the mix? I''ll post the code and logic, then let you decide. My sample data was based on the following:

Table Name:
tblEmployeesPFD
Last Name Field: LastName
First Name Field: FirstName
Combo Box Name: cboNames
Column Count: 2
Bound Column: 1
Initial Row Source Type: Table/Query
Initial Row Source: SELECT tblEmployeePFD.LastName, tblEmployeePFD.FirstName FROM tblEmployeePFD Order By tblEmployeePFD.LastName;

  1. 将组合框(cboNames)的自动扩展属性设置为否。
  2. 我们将使用组合框的Text,NOT Value,Property来构建输入每个字符的RowSource。
  3. 以下代码必须放在cboNames的Change()事件中,它可以在其他地方没有。
  4. 代码将根据使用SQL字符串中的Like运算符输入到cboNames的文本框部分中的每个字符生成一个RowSource,并自动更新文本框。
  5. 我没有多少时间来完全测试代码,所以让我知道你是如何做出来的。还有其他版主/专家比我更精通SQL,他可以指导你完成剩下的操作。

展开 | 选择 | 换行 | 行号


这篇关于处理组合框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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