View Full Version : Get the TERRITORY value by zip code

01-23-2014, 05:26 PM
I have a map with territories. Each zip code is assigned a price value (a territory value) for tolls to that area.

What is the way in VBA to retrieve the assigned value of the territory by providing a particular zip code?

Eric Frost
01-23-2014, 05:36 PM
I've done this, I forgot exactly how. I will dig up the code.

Eric Frost
01-23-2014, 05:47 PM
You have to do something a little bit funky, but I know this works.

First determine the Field Name if you don't already know it --

szField = ds.DataMap.DataFields(0).Name

However I assume you probably do already know it.

Then after looping through the whole recordset, you could access the value like this:

lgValue = rs.Fields(szField)

You'd need a conditional to see if it matches the zip code you are searching for.

Hopefully this helps or at least gets you closer to what you need!

Let us know.