Actually, I think this is a null issue. As an experiment, I added text to the empty BandName field in the Prokofiev record and it worked. The strange thing is, 90% of the records have an empty BandName field and most work fine. So I guess that means that I have a handful of records that have a null in BandName and the rest are empty strings?
Is there a way to allow me to call ConstructName without error even if I'm passing a null value? Or do I need to do something like an UPDATE query that looks for null values and changes them to an empty string or something?
This is the function:
Code:
Public Function ConstructName(fFirst As String, lLast As String, bBand As String) As String
' make sure there are no spaces at the ends
fFirst = Trim(fFirst)
lLast = Trim(lLast)
bBand = Trim(bBand)
If (Len(fFirst & "") > 0) Then
fFirst = "; " & fFirst
End If
If (Len(bBand & "") > 0) Then
bBand = " - " & bBand
End If
ConstructName = lLast & fFirst & bBand
End Function