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 » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

displaying data in expression builder



 
 
Thread Tools Display Modes
  #1  
Old February 24th, 2010, 05:12 PM posted to microsoft.public.access.forms
BakaBard
external usenet poster
 
Posts: 1
Default displaying data in expression builder

I'm working with a table that has abbreviations for longer items (for
example, "P", "E", "S", and "C" = the P means Professional).

I know I've done this before, but can't figure it out. Was hoping to create
an unbound text box in my form that actually shows the longer display (i.e.,
if the field "CATEGORY" = "P", it shows "Professional" instead).

I currently tried:

=If([Category]="P","Professional (Non-Equity)",if([Category]="E","Union
(Equity)",if([Category]="S","Academic",if([Category]="C","Non-Professional"))))

and it's giving me a #Name? error. I've tried taking out the quotes, moving
them to single quotes, quoting the field name instead of the brackets,
nothing helps. Can someone jog my memory?
  #2  
Old February 24th, 2010, 06:42 PM posted to microsoft.public.access.forms
Maurice
external usenet poster
 
Posts: 1,585
Default displaying data in expression builder

replace the if for iif that should do the trick:

=Iif([Category]="P","Professional (Non-Equity)",iif([Category]="E","Union

(Equity)",iif([Category]="S","Academic",iif([Category]="C","Non-Professional"))))

--
Maurice Ausum


"BakaBard" wrote:

I'm working with a table that has abbreviations for longer items (for
example, "P", "E", "S", and "C" = the P means Professional).

I know I've done this before, but can't figure it out. Was hoping to create
an unbound text box in my form that actually shows the longer display (i.e.,
if the field "CATEGORY" = "P", it shows "Professional" instead).

I currently tried:

=If([Category]="P","Professional (Non-Equity)",if([Category]="E","Union
(Equity)",if([Category]="S","Academic",if([Category]="C","Non-Professional"))))

and it's giving me a #Name? error. I've tried taking out the quotes, moving
them to single quotes, quoting the field name instead of the brackets,
nothing helps. Can someone jog my memory?

  #3  
Old February 24th, 2010, 07:11 PM posted to microsoft.public.access.forms
Ron[_23_]
external usenet poster
 
Posts: 27
Default displaying data in expression builder

Just a noob here, but isn't the function "IIF" (not "If")?

-Ron

"BakaBard" wrote in message
...
I'm working with a table that has abbreviations for longer items (for
example, "P", "E", "S", and "C" = the P means Professional).

I know I've done this before, but can't figure it out. Was hoping to
create
an unbound text box in my form that actually shows the longer display
(i.e.,
if the field "CATEGORY" = "P", it shows "Professional" instead).

I currently tried:

=If([Category]="P","Professional (Non-Equity)",if([Category]="E","Union
(Equity)",if([Category]="S","Academic",if([Category]="C","Non-Professional"))))

and it's giving me a #Name? error. I've tried taking out the quotes,
moving
them to single quotes, quoting the field name instead of the brackets,
nothing helps. Can someone jog my memory?


 




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 02:43 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.