Combine fields and skip blanks

Angel69

Registered User.
Local time
Yesterday, 23:19
Joined
Jun 11, 2013
Messages
86
I want to combine six different memo fields into one. I found this code and it works to combine two fields so I edited to add a third and it does not do anything.

Code:
Comments: [QAComments1] & IIf(IsNull([QAComments2]),"","; " & [QAComments2])

This is my edited code to add a third field:

Code:
Comments: [QAComments1] & IIf(IsNull([QAComments2]),"","; " & [QAComments2] & IIf(IsNull([QAComments3]),"","; " & [QAComments3]))

What am I missing to add the other fields? TIA
 
looks like you have a bracket in the wrong place

Code:
Comments: [QAComments1] & IIf(IsNull([QAComments2]),"","; " & [QAComments2][COLOR=red]) [/COLOR]& IIf(IsNull([QAComments3]),"","; " & [QAComments3][COLOR=red])[/COLOR]
 
I'm getting closer to getting it but now it's got the extra semicolons if the field is blank. How do I eliminate them if memo field is blank?
Code:
zzGap: [Gap1] & IIf(IsNull([Gap2]),"","; " & [Gap2]) & IIf(IsNull([Gap3]),"","; " & [Gap3] & IIf(IsNull([Gap4]),"","; " & [Gap4]) & IIf(IsNull([Gap5]),"","; " & [Gap5] & IIf(IsNull([Gap6]),"","; " & [Gap6]) & IIf(IsNull([Gap7]),"","; " & [Gap7])))

See result here:

Verification not complete; ; ; Missing demonstration or statement of due diligence method; ; Supporting email documentation not maintained for disbursement;
 
try changing

IIf(IsNull([Gap2]),"","; " & [Gap2])

to

IIf(nz([Gap2],"")="","","; " & [Gap2])
 

Users who are viewing this thread

Back
Top Bottom