使用表单更新表 [英] Use a form to update a table

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

问题描述

我有一个带有一个下拉框和两个文本框的简单表单。下拉框选择销售区域,然后其中一个文本框自动显示其在显示的销售区域中。所有信息都来自一张桌子。我在如何从第二个文本框中取出用户输入(这将是新的销售代表)并更换表中的旧销售代表时遇到了很多麻烦。任何帮助都将不胜感激!

I''ve got a simple form with one dropdown box and 2 text boxes. the drop down box chooses a sales territory and then one of the other text boxes automatically shows whose in the sales territory shown. All the info is being pulled from one table. I''m having a lot of trouble figuring out how to take user input out of the second text box (which would be the new sales rep) and replace the old sales rep in the table. Any help would be greatly appreciated!

推荐答案

除非您提出的问题比您提及的更多,否则无需使用两个文本框来完成此任务!只需确保文本框的控件源设置为包含旧销售代表的表中的字段。然后,用户键入的任何更改都会自动存储在该字段中。


但是,如果您希望减少可能的用户输入错误,则应使用显示可用销售代表的第二个组合框这样用户只需从组合框中选择代表,而不必输入名称。


问候,

Scott
Unless there''s more to your problem than you mention, there is no need to use two text boxes to accomplish this! Just make sure that the control source of the text box is set to the field in the table that contains your old sales rep. Then whatever changes the user types in are automatically stored in that field.

However, if you wish to reduce possible user entry errors, a second combo box that shows available sales reps should be used so that the user can simply select the rep from the combo box instead of having to type the name in.

Regards,
Scott


Scott,


感谢您的回复,但当我将下拉框的控制源设置为某些内容时,它不允许我从中选择销售区域列表,所以我把它留空并将行源发送到[tblTerritory]。我将一个文本框控件源设置为salespersons名称,但是当我输入任何状态栏时,状态栏显示Control不能编辑;它被绑定到表达式''[tblTerritory]![Sales_Name]" ;.我得到你的地方,但我不知道如何将领土号码与相应的销售名称联系起来,所以我知道我正在改变正确的销售人员,而不是表格中的第一个人。
Scott,

Thanks for the response, but when i set the dropdown box''s Control Source to something it does not let me choose a sales territory from the list, so i have it blank and the Row Source to [tblTerritory]. I have the one text box control source set to the salespersons name, but when i go to type in anything the status bar says "Control can''t be edited; it''s bound to the expression ''[tblTerritory]![Sales_Name]". I get where your going with this, but i dont know how to relate the territory number to the corresponding sales name so i know that i''m changing the correct salesperson, instead of the first person in the table.


这样做的可接受方法是拥有一个像您一样的未绑定组合框。它的控制源设置为空,行源设置如下:
The accepted way of doing this is to have an ''unbound'' combo box like you have. It''s control source set to nothing, the row source set to something like this:
展开 | 选择 | Wrap | 行号


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

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