I'm attempting to write a code to show 6 fields that all have some Null values. The fields will have accompanying text labels that are not a field, and each one needs to be on a different line.
The 6 fields are [TF] [INV] [INV_N] [INV_S] [INV_E] [INV_W]
The desired output would be
I have tried to do research and can't seem to find anything with this many values. The vb-script code I attempted to write is:
Function FindLabel ( [TF], [INV], [INV_N] , [INV_S] , [INV_E] , [INV_W] ) FindLabel = "TF " & [TF] & vbCrLf If IsNull( [INV] ) Then FindLabel = ( [INV_N] ) If isNull ( [INV_N] ) Then FindLabel = ( [INV_S] ) If isNull ( [INV_S] ) Then FindLabel =( [INV_E] ) If isNull ( [INV_W] ) Then Else FindLabel = "INV " & [INV] &vbCrLf Else FindLabel = "INV N " & [INV_N] & vbCrLf Else FindLabel = "INV S " & [INV_S] & vbCrLf Else FindLabel = "INV E " & [INV_E] & vbCrLf Else FindLabel = "INV W " & [INV_W] End If End If End If End If End If End If End Function
My coding experience is 1 Java class my freshman year of college so I'm pretty lost when it comes to this.
If the field has a
Null I would not want the text to be shown nor for there to be an empty space