表格不更新表格 - 更改字段的控制源 [英] form not updating table--changing the control source of a field

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

问题描述



i有一个简单的数据库,可以将客户信息保存在一个表中,将他们的订单保存在另一个表中。

为客户添加新订单时我希望打开表单时,客户名称和id在新订单表单formorder的顶部(在表单'formcustomers''上打开按钮''baddorder'')

u基本上从启动画面的下拉列表中选择客户,可以用一个按钮查看客户信息(地址,电话),用另一个按钮添加新客户,用另一个按钮查看订单,然后添加新订单最后一个按钮。

----新订单''formorder''的字段来自表''tablecustomers''

----这里是添加顺序(baddorder)按钮的代码


i have a simple database that maintains customer info in one table and their orders in another.
when adding a new order for a customer i would like the customer name and id at the top of the new order form ''formorder'' when the form is opened (it is opened with the button ''baddorder'' on the form ''formcustomers'')
u basically choose the customer from a drop down list on the splash screen and can view the customer info (address, telephone) with one button, add a new customer with another button, see their orders with another button, and add a new order with the last button.
----the fields for the new order form ''formorder'' come from the table ''tablecustomers''
----here is the code of the add order (baddorder) button

展开 | 选择 | Wrap | 行号

推荐答案

  • 您可以将客户名称和客户ID值传递给FormOrder通过OpenForm()方法的OpenArgs参数,如:
  • You can pass both the Customer Name and Customer ID Values to FormOrder via the OpenArgs Argument of the OpenForm() Method, as in:
展开 | 选择 | Wrap | 行号


这有点令人困惑。 Fred如何成为Angus Macgyver的签名?


无论如何,因为控制源是告诉Access哪个字段将其绑定到的属性(存储位置)保存记录时包含在其中的数据),根据定义将其设置为计算意味着它写入没有字段。我建议您为控件设置 DefaultValue 。有关 DefaultValue 的信息,请参见帮助页面。 [Name]控件的 DefaultValue 将是 = Forms!formcustomers!name ,[ID]控件的 DefaultValue =表格!formpatients!id


我希望这有帮助。
This is a little confusing. How is Fred a signature for Angus Macgyver?

Anyway, as the Control Source is the property that tells Access which field to bind it to (where to store the data contained in it when the record is saved), setting it to a calculation will, by definition, mean that it writes away to no fields. I suggest you set the DefaultValue for the controls instead. See the Help page for DefaultValue. The DefaultValue for the [Name] control would be =Forms!formcustomers!name and that for the [ID] control, =Forms!formpatients!id.

I hope this helps.


顺便说一下,最后一篇文章(我的)被发布到你之前发布的这个问题的重复主题(因此混淆)。请不要双重提问(我感谢访问者的困惑,除非他们阅读提交帖子后出现的页面)。
By the way, that last post (of mine) was posted to the duplicate thread of this question you posted earlier (hence the confusion). Please don''t double-post questions (I appreciate the confusion for visitors though, unless they read the page that comes up after the post is submitted).


这篇关于表格不更新表格 - 更改字段的控制源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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