表格问题 [英] FORM QUESTION

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

问题描述

我需要从表中获取信息,让我们说一个字段是代理

名称,另一个字段是代理电子邮件地址。我需要一个组合框

,其中包含所有代理名称,一旦我选择了一个名称,

与该名称相关的正确电子邮件地址就会进入任何一个控制

我可能在表格上。我能写:

SELECT DISTINCTROW [Query1]。[Agent Name],[Query1]。[Agent E-mail] FROM

[Query1];它向我显示了2列,第2列绑定它将

显示它们两个,并且一旦我点击名称它将插入

电子邮件地址。我需要一些帮助。


提前致谢,

雷蒙德

I need to take information from a table, let''s say one field is Agent
Name and the other field is Agent e-mail address. I need a combo box
with all of the agent names in there, and once I choose a name, the
correct e-mail address associated with that name goes into any control
that I may have on the form. I was able to write:
SELECT DISTINCTROW [Query1].[Agent Name],[Query1].[Agent E-mail] FROM
[Query1]; It shows me 2 columns, with the 2nd column bound it will
show me both of them, and once I click the name it will insert the
e-mail address. I need a little help.

Thanks in advance,

Raymond

推荐答案

表应该是:

TblAgent

AgentID

AgentName

AgentEmail


你的组合框应该具有以下属性:

绑定列1

列数3

列宽度0; 1.5; 0

然后将以下代码放在组合框的AfterUpdate事件中:

Me!NameOfAgentEmailControl = Me!NameOfCombobox。专栏(2)


-

PC数据表

您的资源获取Access,Excel和Word应用程序的帮助 re******@pcdatasheet.com
www.pcdatasheet.com

< ra ******** @ columbus.rr.com> ;在消息中写道

news:11 ********************** @ f14g2000cwb.googlegr oups.com ...
The table should be:
TblAgent
AgentID
AgentName
AgentEmail

Your combobox should have the following properties:
Bound Column 1
Column Count 3
Column Widths 0;1.5;0

You then put the following code in the AfterUpdate event of the combobox:
Me!NameOfAgentEmailControl = Me!NameOfCombobox.Column(2)

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com
<ra********@columbus.rr.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
我需要从表中获取信息,让我们说一个字段是代理
名称,另一个字段是代理电子邮件地址。我需要一个包含所有代理名称的组合框,一旦我选择了一个名称,
与该名称相关的正确电子邮件地址就会受到任何控制。在表格上。我能够写:
SELECT DISTINCTROW [Query1]。[Agent Name],[Query1]。[Agent E-mail] FROM
[Query1];它显示了2列,第2列绑定它将显示它们两个,一旦我点击名称它将插入
电子邮件地址。我需要一点帮助。

提前致谢,

Raymond
I need to take information from a table, let''s say one field is Agent
Name and the other field is Agent e-mail address. I need a combo box
with all of the agent names in there, and once I choose a name, the
correct e-mail address associated with that name goes into any control
that I may have on the form. I was able to write:
SELECT DISTINCTROW [Query1].[Agent Name],[Query1].[Agent E-mail] FROM
[Query1]; It shows me 2 columns, with the 2nd column bound it will
show me both of them, and once I click the name it will insert the
e-mail address. I need a little help.

Thanks in advance,

Raymond





感谢您的回复!我试过了,我唯一没有理解的是我需要在表格中更改的内容。我是否需要添加

这些包含信息的字段?其中一个只是一个主要的

键吗?我是否离开组合框查看查询或是否创建了一个

组合框并让它查看表格?

***通过Developersdex发送 http://www.developersdex.com ***

Don''只是参加USENET ...获得奖励!

Thanks for the response! I tried that and the only thing I did not
understand was what I needed to change in the table. Do I need to add
those fields with information in them? Are one of them just a primary
key? Do I leave the combo box looking at the query or do I create a
combo box and have it look at the table?
*** Sent via Developersdex http://www.developersdex.com ***
Don''t just participate in USENET...get rewarded for it!


你的桌子的结构需要和我展示的一样。如果您的

表没有这种结构,我建议你改变你的表。你可以使用你自己的表名和你自己的字段名来
。那么您的数据

需要在相应字段的此表中。请注意,AgentID是

主键,是自动编号。对于组合框,您可以将

rowsource属性设置为表,也可以创建查询并将

rowsource属性设置为查询。使用

查询有两个原因:

1.限制使用某种查询可以选择哪些代理

2 。按字母顺序对代理名称进行排序

如果您决定使用查询,请确保查询字段与表中的字段具有相同的

顺序。设置组合框的

属性的说明将与我为

表提供的相同。最后,请确保在AfterUpdate

事件中使用正确的控件名称。


-

PC数据表

您的资源以获取Access,Excel和Word应用程序的帮助
re ****** @ pcdatasheet。 com
www.pcdatasheet.com

Raymond Tackett < RA ******** @ columbus.rr.com>在消息中写道

news:41 ********** @ 127.0.0.1 ...
The structure of your table needs to be the same as whay I show. If your
table does not have this structure, I suggest you change your table. You can
use your own table name and your own names for the fields. Your data then
needs to be in this table in the proper fields. Note that AgentID is the
primary key and is autonumber. For your combobox, you can either set the
rowsource property to the table or you can create a query and set the
rowsource property to the query. There would be two reasons for using a
query:
1. To limit which Agents can be selected by using some kind of query
2. To sort the agent names alphabetically
If you decide to use the query, be sure the query fields are in the same
order as the fields in the table. The instructions for setting the
properties for the combobox will then be the same as I provided for the
table. Finally, be sure to use the correct control names in the AfterUpdate
event.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com
"Raymond Tackett" <ra********@columbus.rr.com> wrote in message
news:41**********@127.0.0.1...

感谢您的回复!我试过了,我唯一不了解的就是我需要在表格中改变的东西。我是否需要添加包含信息的字段?其中一个只是一个主要的关键?我是否离开组合框查看查询或是否创建一个
组合框并查看表格?

***通过Developersdex发送 http://www.developersdex.com ***
不要只参加USENET ......获得奖励!

Thanks for the response! I tried that and the only thing I did not
understand was what I needed to change in the table. Do I need to add
those fields with information in them? Are one of them just a primary
key? Do I leave the combo box looking at the query or do I create a
combo box and have it look at the table?
*** Sent via Developersdex http://www.developersdex.com ***
Don''t just participate in USENET...get rewarded for it!



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

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