控制源如果语句 [英] Control Source If statement

查看:156
本文介绍了控制源如果语句的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想获得自动计算输出,如果输入的值> 0。所以我把下面的code在一个文本框属性控制源字段,它给我一个错误。应从Text052得到的数量和它应该输出它在Text054

I want access to automatically calculate the output if the entered value is > 0. So I put the following code in the "Control Source" field of a textbox property and it is giving me an error. The Number should be obtained from Text052 and it should output it in Text054.

下面是code:

If Text052.value > 0 then
Text054.value = Val([Text052].[Value])/2
end if

错误:你enetered的EX pression包含无效语法。        你enetered的操作无需操作

Error: "The expression you enetered contains invalid syntax". "You have enetered the operand without the operator"

我不知道如何写在文本框中欢迎使用属性的控制源字段的语法。 请指点。

I am not sure how to write the syntax in the control source field of the text box propety. Please advice.

推荐答案

在Text054的控制源,请尝试:

In the control source of Text054, try:

=IIf([Text052] > 0,[Text052]/2, "N/A")

N / A可以是任何你需要的,包括null。

"N/A" can be whatever you need, including null.

这篇关于控制源如果语句的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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