Awesome! It works!! I can't believe it! So cool.
I didn't have quotes around my "PathToRelatedTable" so that works now and I don't have to have the table in my TOC then. But in production I actually want to use an SDE table so I will have that in my TOC so I will just use the "RelatedTableName" like you mentioned. Thank you!
I have a further question though. In my code below I added a Quantity field to my label. But when the Quantity is 1 I don't want it to put the "(1)" there. I just want the "(2)" quantity label when the Quantity > 1. Do you know how to add in this logic?
Code:
Function FindLabel ( [UniqueID] )
Set gp = CreateObject("esriGeoprocessing.GPDispatch.1")
strWhereClause = chr(34) & "UniqueID" & chr(34) & " = '" & [UniqueID] & "'"
strpTable = "FIBER_ASSEMBLY_UNITS"
Set prows = gp.searchcursor(strpTable,strWhereClause)
Set prow = prows.next
Do until prow is nothing
strLabel = prow.ASSEMBLY_UNIT & " (" & prow.Quantity & ")"
FindLabel = FindLabel & strLabel & vbnewline
Set prow = prows.next
Loop
End Function
Thank you!