Re: Comma in concatenated field

Tech-Archive recommends: Speed Up your PC by fixing your registry



Bassel wrote:

>I have a test box that combines several fields using IIf statment
>=IIf([cofa]=-1,"AAAAAA") & IIf([cofconf]=-1," , BBBBBB") &
>IIf([cofcomp]=-1," , CCCCC")
>
>My problem is with the comma if [cofa]=0 and [cofconf]=-1 or [cofcomp]=-1
>then the ouput will be
> ,BBBBBB or ,CCCCC
>How to manage the comma to appear only , if there is a value before it.


Here's one way:

=Mid(IIf(cofa,", AAAAAA") & IIf(cofconf,", BBBBBB") &
IIf(cofcomp,", CCCCC"), 3)

--
Marsh
MVP [MS Access]
.