make a text box only visible if txtName Has a value entered on a f

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to make a text box (txtfinal) that has an expression like this:
If "txt1" >8, then subtract 8 from "txt1"
and also if lstName is null then txtFinal is null also

"txt1" is a text box from a form that has a mathematical equation on it.
the final number is imported into the "txtFinal" if the number is greater
than 8 it needs to have 8 subtracted from it.

"lstName" is a list box on the same report with user name in it. It
references a specific user ID and Name from a form. (if this value is null,
then the "txtFinal" does not need to appear).

The key is that I cannot get the txtFinal to ONLY APPEAR IF NEEDED (if
txtName IS NOT Blank. I have tried for weeks to figure out the code to work
but cannot figure it out..... please help.....
 
Walter said:
I need to make a text box (txtfinal) that has an expression like this:
If "txt1" >8, then subtract 8 from "txt1"
and also if lstName is null then txtFinal is null also

"txt1" is a text box from a form that has a mathematical equation on it.
the final number is imported into the "txtFinal" if the number is greater
than 8 it needs to have 8 subtracted from it.

"lstName" is a list box on the same report with user name in it. It
references a specific user ID and Name from a form. (if this value is null,
then the "txtFinal" does not need to appear).

The key is that I cannot get the txtFinal to ONLY APPEAR IF NEEDED (if
txtName IS NOT Blank. I have tried for weeks to figure out the code to work
but cannot figure it out..... please help.....


Try this kind of expression in the report text boxes:

=IIf(lstName Is Null, Null,
IIf(Forms!theform.Forms!theform.txt1 > 8,
Forms!theform.Forms!theform.txt1 - 8,
Forms!theform.Forms!theform.txt1))

But you will probably have to unravel the references because
I am not sure which items are on the form and which ones on
in the report. It would have helped me keep it straight if
you had provided the name of the form and report.
 
Back
Top