在其他字段更改时触发文本框上的默认值 [英] Make default value on textbox triggered when other field change

查看:56
本文介绍了在其他字段更改时触发文本框上的默认值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


所以我的表单上有一些文本框,在最后一个文本框中,我关闭了
enable
所以我没有要求用户输入,而是想让文本框上的值在用户输入另一个文本框时自动计算,所以我设置了这样的默认值:

 

 = IIf(IsNull([jmlh]),0,[jmlh] * [harga] * IIf([diskon]> 0,[diskon],1))



但问题是表达式只在表单加载时才起作用,它仍然不是在"[jmlh]"中的值时;更改。有没有什么方法可以让它成为可能?

解决方案

尝试将文本框的控制源设置为表达式


<跨度> = <跨度> I如果 <跨度>( <跨度> ISNULL <跨度>([ <跨度> jmlh <跨度>]), <跨度> 0 <跨度>,[ <跨度> jmlh <跨度>] * [ <跨度>价格< /跨度> <跨度>] * <跨度> I如果 <跨度>([ <跨度> diskon <跨度>]> <跨度> 0 <跨度>,[ <跨度> diskon <跨度>], <跨度> 1 <跨度>))


So I have some textbox on my form,and on the last textbox, I turn off the enable so instead of asking the user for the input, I want to make the value on the textbox calculate automatically when the user input on another textbox, so I set the default value like this :

=IIf(IsNull([jmlh]),0,[jmlh]*[harga]*IIf([diskon]>0,[diskon],1))


But the problem is the expression just work when the form loaded, it's still not when value in "[jmlh]" change. Is there any method or something to make it possible?

解决方案

Try setting the Control Source of the text box to the expression

=IIf(IsNull([jmlh]),0,[jmlh]*[harga]*IIf([diskon]>0,[diskon],1))


这篇关于在其他字段更改时触发文本框上的默认值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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