I am trying to do some advanced labeling with VBScript and need some help getting to the finish line. I have never scripted anything prior to last week so I am definitely a newbie when it comes to VBScripting.
Here is my problem- I have hundreds of soil borings at which several samples have been collected at varying depths. The number of samples collected at each location varies as does the depth. So I wrote a very simple script to get my labels into a table format. I concatenated two fields in excel (Depth and Result) separated by spaces to create the [LABEL] field.
My issue now is adding an expression into my existing script which will return no values if no data is present in the data table. What I'm getting now is just several blank lines when samples were not collected at that depth. See the attached image for reference.
How can I fix my expression in order to skip these blanks?
Here is the script I have thus far...
"<FNT name= 'Arial' size='10'><BOL>" & [Sample_ID] & "</BOL></FNT>" + vbnewline + "<UND>" & "DEPTH (BGS)" & "</UND>" + " " + "<UND>" & "LEAD (MG/KG)" & "</UND>" + vbnewline + vbnewline + [ALABEL] + vbnewline + [BLABEL] + vbnewline + [CLABEL] + vbnewline + [DLABEL]
This has all been done in the simple label expression maker within ArcGIS so far. I assume I will need to add some kind of if then statement and a loop to get what I need. But like I said earlier... I am no expert at scripting yet.