This should give you something to work with for your UDF.
Warning <<< AIR CODE >>>
Code:
Function MyString(InDescription As String, _
InPast As String, _
InFuture As String) As String
Dim MyCount As Integer
MyCount = 0
' Receive up to 3 strings in the following form:
' Bob: House; Cat;
' Jim: Apartment; Dog;
' Betty: House; Hamster;
' Return them in one string in the following form:
' 1. Bob: House; Cat; 2. Jim: Apartment; Dog; 3. Betty: House, Hamster;
' In our case it is invoked in a query this way:
' YourField = MyString(Consolidated.Description, _
' Consolidated.[Significant Events - Past], _
' Consolidated.[Significant Events - Future])
If Len(InDescription & "") > 0 Then
MyString = "1. DESCRIPTION: " & InDescription
MyCount = 1
End If
If Len(InPast & "") > 0 Then
If Len(MyString & "") > 0 Then
MyString = MyString & " 2. SIG EVENTS PAST: " & InPast
Else
MyString = "1. SIG EVENTS PAST: " & InPast
End If
MyCount = MyCount + 1
End If
If Len(InFuture & "") > 0 Then
Select Case MyCount
Case 0
'-- Nothing so far
MyString = "1. SIG EVENTS FUTURE: " & InFuture
Case 1
'-- Only one parameter so far
MyString = MyString & " 2. SIG EVENTS FUTURE: " & InFuture
Case 2
'-- Got both prior parameters
MyString = MyString & " 3. SIG EVENTS FUTURE: " & InFuture
End Select
Else
If MyCount = 0 Then
'-- We need to return at least something
MyString = "No Significant Events; "
End If
End If
End Function