I am trying to add a line to an existing script. I have created a new attribute field [PlantDate], and need it to reflect in the label expression.
This is the current script:
Function FindLabel ( [FieldName], [FarmAcres], [FutureCrop1], [FutureCrop2], [FutureCrop3], [IrrigationType] )
If (IsNull ([FutureCrop2]) AND IsNull ([FutureCrop3])) Then
FindLabel = "Field #" + [FieldName] & vbCrLf & [FarmAcres] + " Acres" & vbCrLf& [FutureCrop1] & vbCrLf& [IrrigationType]
ElseIf IsNull ([FutureCrop3]) Then
FindLabel = "Field #" + [FieldName] & vbCrLf & [FarmAcres] + " Acres" & vbCrLf& [FutureCrop1] + "/ " + [FutureCrop2] & vbCrLf& [IrrigationType]
Else
FindLabel = "Field #" + [FieldName] & vbCrLf & [FarmAcres] + " Acres" & vbCrLf& [FutureCrop1] + "/ " + [FutureCrop2] + "/ " + [FutureCrop3] & vbCrLf& [IrrigationType]
End If
End Function
I need it to include the new "plant date" field [PlantDate] on the next line. I did the following script but it is only showing the features of the original script so I am unsure what I am doing wrong (note: the field is not <null>, I have a value in the field for this polygon). This is the script I tried:
Function FindLabel ( [FieldName], [FarmAcres], [FutureCrop1], [FutureCrop2], [FutureCrop3], [IrrigationType], [PlantDate] )
If (IsNull ([FutureCrop2]) AND IsNull ([FutureCrop3])) Then
FindLabel = "Field #" + [FieldName] & vbCrLf & [FarmAcres] + " Acres" & vbCrLf& [FutureCrop1] & vbCrLf& [IrrigationType] & vbCrLf& [PlantDate]
ElseIf IsNull ([FutureCrop3]) Then
FindLabel = "Field #" + [FieldName] & vbCrLf & [FarmAcres] + " Acres" & vbCrLf& [FutureCrop1] + "/ " + [FutureCrop2] & vbCrLf& [IrrigationType] & vbCrLf& [PlantDate]
Else
FindLabel = "Field #" + [FieldName] & vbCrLf & [FarmAcres] + " Acres" & vbCrLf& [FutureCrop1] + "/ " + [FutureCrop2] + "/ " + [FutureCrop3] & vbCrLf& [IrrigationType] & vbCrLf& [PlantDate]
End If
End Function
The system says it is valid, but it is not showing that added [PlantDate] information on the polygon. Refreshing and reloading is not correcting it either. Ideally, I would like it to have the text "Plant Date" following the value (like I have ' + " Acres" ' for field acres) but it says there is an error when I attempt, and it blues out the word "date."
Any help/advice would be great appreciated! Thank you.