[AccessD] Find intersections

Bob Gajewski rbgajewski at roadrunner.com
Mon Oct 11 22:55:48 CDT 2010


Hi All
 
I have a small name-and-address style database. This is for use within a
fire district, so the 1100 records are all contained on 26 different
streets.
 
I need to export the data to Excel (text delimited using the tilde as the
separator), and I have a make-table query that runs just fine for 99% of the
information.
 
The problem is that I need to add two 'calculated' text fields to each
record - I need to include the two streets that each address is between. I
imagine that I need some type of code to loop through the remaining records
in both directions to find the next intersecting street.
 
The MakeTable query creates:
"StreetNumber"~"StreetName"~"StreetAddlInfo"~"StreetSide"~"StreetIntersectin
g"~"StreetBetween1"~"StreetBetween2"
"12300"~"Main St."~""~"(intersection)"~"Church St."~""~""
"12315"~"Main St."~""~"South"~""~""~""
"12330"~"Main St."~"Apt. A"~"North"~""~""~""
"12330"~"Main St."~"Apt. B"~"North"~""~""~""
"12345"~"Main St."~""~"South"~""~""~""
"12360"~"Main St."~""~"(intersection)"~"Upper Ave."~""~""
"12375"~"Main St."~"Lot 14"~"North"~""~""~""
"12385"~"Main St."~""~"South"~""~""~"" 
"12390"~"Main St."~""~"(intersection)"~"Alpine Ct."~""~""
 
What I need to end up with is:
"StreetNumber"~"StreetName"~"StreetAddlInfo"~"StreetSide"~"StreetIntersectin
g"~"StreetBetween1"~"StreetBetween2"
"12300"~"Main St."~""~"(intersection)"~"Church St."~""~""
"12315"~"Main St."~""~"South"~""~"Church St."~"Upper Ave."
"12330"~"Main St."~"Apt. A"~"North"~""~"Church St."~"Upper Ave."
"12330"~"Main St."~"Apt. B"~"North"~""~"Church St."~"Upper Ave."
"12345"~"Main St."~""~"South"~""~"Church St."~"Upper Ave."
"12360"~"Main St."~""~"(intersection)"~"Upper Ave."~""~""
"12375"~"Main St."~"Lot 14"~"North"~""~"Upper Ave."~"Alpine Ct."
"12385"~"Main St."~""~"South"~""~"Upper Ave."~"Alpine Ct." 
"12390"~"Main St."~""~"(intersection)"~"Alpine Ct."~""~""
 
Would I loop through the records in each direction, looking for the next
record where [StreetSide] = "(intersection)", and where would I put that
code ... I did not see it available in the query design ...
 
Thanks in advance,
 
Bob Gajewski
 



More information about the AccessD mailing list