A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Set value of a text box conditionally



 
 
Thread Tools Display Modes
  #1  
Old July 24th, 2007, 10:52 PM posted to microsoft.public.access.reports
J. Cairn
external usenet poster
 
Posts: 2
Default Set value of a text box conditionally

I have two text boxes on a report. One is bound to a field in a table.
The other has a formula that combines the values from two other table
fields.

If there is a particular value in the bound field, I want the unbound
text box to display a particular text string, instead of the string
that it now displays as a result of the formula.

How do I do that? Thanks.

  #2  
Old July 25th, 2007, 12:46 AM posted to microsoft.public.access.reports
Armen Stein
external usenet poster
 
Posts: 507
Default Set value of a text box conditionally

On Tue, 24 Jul 2007 14:52:33 -0700, "J. Cairn"
wrote:

I have two text boxes on a report. One is bound to a field in a table.
The other has a formula that combines the values from two other table
fields.

If there is a particular value in the bound field, I want the unbound
text box to display a particular text string, instead of the string
that it now displays as a result of the formula.

How do I do that? Thanks.


You can use an IIF (Immediate If), something like:

=IIF([boundcontrolname]="MySpecialValue", "My Particular String",
[insertoriginalformulahere])

In English this means:

If the bound control equals a particular value,
show a particular string
otherwise
show the results of a formula


Armen Stein
Microsoft Access MVP
www.JStreetTech.com

  #3  
Old July 25th, 2007, 01:17 AM posted to microsoft.public.access.reports
J. Cairn
external usenet poster
 
Posts: 2
Default Set value of a text box conditionally

That looks like it will work. THANK YOU!


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:42 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.