Unbound TextBox value (1 Viewer)

JPR

Registered User.
Local time
Today, 15:34
Joined
Jan 23, 2009
Messages
175
Hello,

I have a form on which I have added an unbound textbox (txtResult) which I would like to return a given value depending if data is entered or not in another textbox (txt3).

Currently, txtResult shows a value between txt1 and txt2 (which is located in a subform.

txtResult has the following control source code:
Code:Copy to clipboard
[txtAmount1]-Forms!Form1!Subpartial!txtAmount2

Is it possible that txtResult shows by default, the formula which I have indicated in the Control Source and the value 0 (zero), if txt3 has data?

Thank you
 

Gasman

Enthusiastic Amateur
Local time
Today, 23:34
Joined
Sep 21, 2011
Messages
9,297
Try the IIF() function ?
 

JPR

Registered User.
Local time
Today, 15:34
Joined
Jan 23, 2009
Messages
175
No. Honestly I wouldn’t know how to write the code. Thanks
 

Gasman

Enthusiastic Amateur
Local time
Today, 23:34
Joined
Sep 21, 2011
Messages
9,297
No. Honestly I wouldn’t know how to write the code. Thanks
Might want to try something else to learn then? :(
This is very basic VBA. and you will need to write a lot more, so may as well start learning now?

I just tested thisin a form of mine. I am not giving you the EXACT code, but the logic.

Up to you to change the names to suit?

Code:
=Iif(Len([text3] & "") > 0,0,[text1]-[text2])
 

JPR

Registered User.
Local time
Today, 15:34
Joined
Jan 23, 2009
Messages
175
Thanks you. I will on the code.
 

Users who are viewing this thread

Top Bottom