Hi there,
I am trying to concatenate the results of several fields into one field, with each result separated by a comma. However, some fields are empty, so I don't want there to be commas with nothing between (as I have to export the query as an Excel document, and then as a CSV). Here's an example of what I'm trying to do:
That's just part of it, there are a couple more fields involved, and then I'll be doing a similar one for even more fields. Now, I've been trying to figure out a way to get rid of any unnecessary commas - I can't nest the Iif functions, because I may need the results of all of the fields, or just some of the fields, in this one expression. I could not find any expression functions that really met my needs, so I was attempting to write a new function in VBA, but I am failing miserably, having not touched Visual Basic in almost two years. It doesn't help, either, that if a person wants to use VBA in Access they have to define an Object and that is well outside of the realm of what I recall from VBA.Code:Expr 1: Iif(IsNull([Roles]![Expression]=True),"","Adminstrator, ") & Iif(IsNull([Roles]![Expr2]=True),"","Content Manager, ")
I apologize if this thread is an ill fit for this forum, and should in fact be in the Programming forum. I've been at this for days and am really at a loss, so if anyone has any suggestions I would greatly appreciate them.