Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Control Source If statement

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.

Here is the code:

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

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.

like image 606
Ish Avatar asked Sep 07 '26 16:09

Ish


1 Answers

In the control source of Text054, try:

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

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

like image 125
Fionnuala Avatar answered Sep 10 '26 15:09

Fionnuala