[AccessD] code to find the population within a radius of a zip code

JWColby jwcolby at colbyconsulting.com
Fri May 4 11:04:58 CDT 2007


What kind of records are you pulling, how many, and what is the response
time.

I did it with a class that has a collection of child classes.  Each child
class holds one point.  The parent class iterates the collection of child
classes comparing every child class to one specific selected child class.

The company I did it for wants a "circle around a business".  The
calculation to find the distance is obtuse and uses a lot of math (radians,
sin, cos etc) but I didn't write it, I just found it.

If you wish I will send you a zip with the application.  It is a table of
about 70K zip codes, a couple of queries to narrow down the zips (exclude
any with no lat/long) to about 42K unique zips, a form and a couple of
classes to implement the logic.  I pared the unused data fields out and the
resultant database is about 6.7 mb unzipped, 2.25 zipped.

John W. Colby
Colby Consulting
www.ColbyConsulting.com

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Borge Hansen
Sent: Friday, May 04, 2007 11:19 AM
To: Access Developers discussion and problem solving
Subject: [AccessD] code to find the population within a radius of a zip code

>John Colby wrote:
>I converted the code to find the population within a radius of a zip code.

Hi John,
What does your VBA code look like?

I am using a code that will find a subset of records based on their geocode
within a near enough square,

...and querying the recordset like this

....find me all record instances where Lat of record is between
"northernmost Lat" and "southernmost Lat" and Long of record is between
"most western Long" and "most eastern Long"

Interested to see your code based on a circle construct.....

Regards
borge

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list