将表单中控件的值基于同一表单的另一个计算控件 [英] Base the value of a control in a form on another calculated control of same form

查看:56
本文介绍了将表单中控件的值基于同一表单的另一个计算控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用SetValue宏将计算控件的值分配给同一表单上的另一个BOUND控件,但尚未成功。我遵循MS Access帮助说明中显示的确切格式。

金额在未绑定的文本框中正确显示(从同一表单中的子表单中的数据派生),但是我无法获得该金额然后出现在绑定控件的文本框中使用SetValue宏。

我只是这样做,因为我不知道如何从子表单附加计算量直接填充绑定控件。

(子表单包含发票上的一系列项目。主表单是实际发票,我想将每个项目成本的总价记录到相关记录上使用发票。

我不做代码,想知道如何使用宏或只是键入与文本框关联的属性部分。

感谢您的预期帮助。

BigDaddrock

I have tried using the SetValue Macro to assign the value of a calculated control to another BOUND Control on the same form but have not been successful. I followed the exact format shown in MS Access help instructions.
The amount appears properly in the unbound text box (derived from data in a subform within the same form), however I cannot get that amount to then appear in a Bound Control''s text box using the SetValue macro.
I am only doing it this way, since I do not know how to attach a calculated amount from the subform to directly populate a Bound Control.
(The subform contains a series of items on an invoice. The Main Form is the actual invoice, and I would like to record the total price of each of the item''s costs onto a record associated with the Invoice.
I do not do code, and would like to know how I can do this using macros or just keying into a section of the Properties associated with the text Box.
Thanks for the anticipated help.
BigDaddrock

推荐答案

当您尝试这样做时会发生什么?您收到错误消息吗?某种形式?还是只是没有发生任何事情?主要表格的其余部分是否正确填充了该客户和发票的数据?


Pat
What happens when you attempt to do this? Are you getting an error message of some kind? Or is it just that nothing at all is happening? Does the rest of the main form populate correctly with the data for that customer and invoice?

Pat


@ zepphead80


I将SetValue宏发生在At Change处。第一个文本框的位置(正确记录SubForm中的总金额的文本框)。但是,目标框保持不变。后一个是我想要画的地方。第一个文本框中出现的总金额。
@zepphead80
I have the SetValue macro taking place at the "At Change" position of the first Text Box (the one that is properly recording the sum amount from the SubForm). However, the destination box remains with no change. That latter one is where I would like to "paint" the sum amount appearing in the first Text Box.


我必须承认我从不使用宏,并且我不熟悉您正在谈论的SetValue功能。


当您尝试直接在相关文本框中输入内容时会发生什么?并不是说你会在练习中一直这样做 - 我只是好奇地看看它是如何回应的。


Pat
I have to confess that I never use macros, and I am not familiar with the SetValue feature that you are talking about.

What happens when you try to enter something directly into the text box in question? Not that you''ll be doing this all the time in practice - I''m just curious to see how it responds.

Pat


这篇关于将表单中控件的值基于同一表单的另一个计算控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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