Hiding Text Boxes

  • Thread starter Thread starter eschlep via AccessMonster.com
  • Start date Start date
E

eschlep via AccessMonster.com

I have textboxes in a report that are based off of a form. I was wanting to
know how to hide a text box if it does not have anything in it. I would also
like to know if there is a quick and easy way to do alot of them. THanks.
 
Try an IIF function:
IIf(expr, truepart, falsepart)
expr=textbox value is not null
truepart=textbox.visible set to true
falsepart=textbox.visible set to false
Let me know if this helps.
 
Where do i put the IIF Function. If it is in the control source I already am
telling it to pull from a form so i have this in the control source now, =
[Forms]![LNREVIEWQ1]![Combo1553], so how would i enter both. Thanks
 
Set [Forms]![LNREVIEWQ1]![Combo1553], as your expression:
Iff([Forms]![LNREVIEWQ1]![Combo1553] is null,textbox.visible set to
true,([Forms]![LNREVIEWQ1]![Combo1553])
textbox.visible set to true=the textbox number

eschlep via AccessMonster.com said:
Where do i put the IIF Function. If it is in the control source I already am
telling it to pull from a form so i have this in the control source now, =
[Forms]![LNREVIEWQ1]![Combo1553], so how would i enter both. Thanks
Try an IIF function:
IIf(expr, truepart, falsepart)
expr=textbox value is not null
truepart=textbox.visible set to true
falsepart=textbox.visible set to false
Let me know if this helps.
 
I still get an error, My text box is Text1048 and the control still has the
same thing in it. Could you post the statement on here so i could copy and
paste it to see if it will work. Thanks
Set [Forms]![LNREVIEWQ1]![Combo1553], as your expression:
Iff([Forms]![LNREVIEWQ1]![Combo1553] is null,textbox.visible set to
true,([Forms]![LNREVIEWQ1]![Combo1553])
textbox.visible set to true=the textbox number
Where do i put the IIF Function. If it is in the control source I already am
telling it to pull from a form so i have this in the control source now, =
[quoted text clipped - 10 lines]
 
This should work:
Iff([Forms]![LNREVIEWQ1]![Combo1553] is
null,text1048.visible=false,([Forms]![LNREVIEWQ1]![Combo1553])

Sorry I put true in the place where false should have been in my previous
reply

Also there is a difference between null and an empty set
example if a value is place in a record and the value (not the record) is
deleted, the value is now an empty set and not null. A little confusing I
know.
If null does not work try this:

Iff([Forms]![LNREVIEWQ1]![Combo1553]
="",text1048.visible=false,([Forms]![LNREVIEWQ1]![Combo1553])

Hope this helps.

eschlep via AccessMonster.com said:
I still get an error, My text box is Text1048 and the control still has the
same thing in it. Could you post the statement on here so i could copy and
paste it to see if it will work. Thanks
Set [Forms]![LNREVIEWQ1]![Combo1553], as your expression:
Iff([Forms]![LNREVIEWQ1]![Combo1553] is null,textbox.visible set to
true,([Forms]![LNREVIEWQ1]![Combo1553])
textbox.visible set to true=the textbox number
Where do i put the IIF Function. If it is in the control source I already am
telling it to pull from a form so i have this in the control source now, =
[quoted text clipped - 10 lines]
know how to hide a text box if it does not have anything in it. I would also
like to know if there is a quick and easy way to do alot of them. THanks.
 
Back
Top