if condition

jerry28ph

jerry
Local time
Yesterday, 16:03
Joined
Nov 16, 2008
Messages
141
Hi, can we use if condition in access statement? I tried to create a 2 textbox on the form and 1 command button and i wrote the following:

if text1.text="A" then
text2.text="Apple"
else
text2.text="Banana"
end if

..but this statement did not work. please help me to use the right syntax.

Thanks.
Jerry
 
Try;
Code:
if text1.value="A" then
     text2.value="Apple"
else
     text2.value="Banana"
end if
 
It's always helpful when you give us something more descriptive than "did not work". Did it error, and if so what was it? Right off I can tell you to drop the .Text from all your references, as it requires focus.
 

Users who are viewing this thread

Back
Top Bottom