Labeling locations via an external table

700
2
02-16-2012 07:01 AM
MathieuCain
New Contributor III
Hello,

I have a table in MS Access ([Loc], [Date], [Label]), which I want to use to populate labels in ArcMap 10.

i.e., each location on the map gets a label box with the field header [Date] and [Label] followed by however many records for that location on subsequent lines (note: the number of records may vary between locations).

Do you know of any VBScript code I could use for the label field Expression?

Thanks!
Tags (2)
0 Kudos
2 Replies
RichardFairhurst
MVP Honored Contributor
Hello,

I have a table in MS Access ([Loc], [Date], [Label]), which I want to use to populate labels in ArcMap 10.

i.e., each location on the map gets a label box with the field header [Date] and [Label] followed by however many records for that location on subsequent lines (note: the number of records may vary between locations).

Do you know of any VBScript code I could use for the label field Expression?

Thanks!


There is no code that you could put into the Label Expression that would do this using VBScript assuming by many records you mean actual table records and not comma delimited values.  To accomplish what you want you would have to use a cursor to read multiple records, but VBScript does not include cursor support.  If you have an ArcInfo licence, there is a way to convert a 1:M relationship into a 1:1 relationship with the Pivot table tool, but use of that tool would not support any live response to edits in your original Access table.  There was an extension or tool to do this for 9.3, but I do not know if the code was ported for use with 10 or if it would work with an Access table or just a dbf or geodatabase table.  Search the forums.  There have been dozens of discussions on this subject.

This is the most recent post on the subject and it indicates that the code has not been ported and what would be involved to port it for use with 10.
0 Kudos
MathieuCain
New Contributor III
There is no code that you could put into the Label Expression that would do this using VBScript assuming by many records you mean actual table records and not comma delimited values.  To accomplish what you want you would have to use a cursor to read multiple records, but VBScript does not include cursor support.  If you have an ArcInfo licence, there is a way to convert a 1:M relationship into a 1:1 relationship with the Pivot table tool, but use of that tool would not support any live response to edits in your original Access table.  There was an extension or tool to do this for 9.3, but I do not know if the code was ported for use with 10 or if it would work with an Access table or just a dbf or geodatabase table.  Search the forums.  There have been dozens of discussions on this subject.

This is the most recent post on the subject and it indicates that the code has not been ported and what would be involved to port it for use with 10.


Thank you for your thoughts. In the end I did in fact use a function in VBScript. I will try and post the solution in the near future.
0 Kudos