Calculated Field Error

I use the following generic function for names and any other sets of values which require concatenating. It was originally adapted from a CanShrinkLines function published by Microsoft many years ago for returning an address, suppressing Null lines:

Code:
Public Function ConcatValues(strSeparator As String, ParamArray arrVals())
 
    ' Pass this function a character or characters
    ' to be used as the separator followed by the values to be combined
    ' For example: strFullName =
    ' ConcatValues(" ",FirstName, MiddleName,LastName)
   
    Dim X As Integer, strLine As String
   
    For X = 0 To UBound(arrVals)
        If Not IsNull(arrVals(X)) And Trim(arrVals(X)) <> "" Then
          strLine = strLine & strSeparator & arrVals(X)
        End If
    Next
     
    ' remove leading separator character(s)
    ConcatValues = Mid(strLine, Len(strSeparator) + 1)
 
End Function

Not that dissimilar to what I use. However, I tailored it because of knowing some specifics of the structure of the genealogy data files which are in GEDCOM format. It is essentially an entity-attribute-value style of data presentation with a quirky 5-part hierarchical definition for the attribute part of the EAV presentation.
 

Users who are viewing this thread

Back
Top Bottom