在其他字段更改时触发文本框上的默认值 [英] Make default value on textbox triggered when other field change
问题描述
所以我的表单上有一些文本框,在最后一个文本框中,我关闭了
所以我没有要求用户输入,而是想让文本框上的值在用户输入另一个文本框时自动计算,所以我设置了这样的默认值:
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屋!