473,386 Members | 1,810 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Search/find postcodes from table within inputted postcode & radius

56
s there such a plug in or piece of code that can handle the
following scenario?

1) I have a list of suppliers, goods they sell and addresses/postcodes
2) Customer comes along, says they need item X but must be from a
supplier within 7 miles of their location
3) I pump in their postcode and I get the result being the location of
all relevant suppliers within that radius who are able to stock item X*

*Item X will always have the same code between suppliers (we will be designating it an ID).

I have heard of someone who has something that can find the location
of suppliers within a radius set up in an Excel spreadsheet, but they
WON'T share it! So throwing myself on you guys for assistance. If it can be Excel-ised, I'm sure it can be Access-ed!

Trawled the net to no real avail. So relying on the experience of
others. Any info would be great really!

Thanks

Si
Apr 13 '07 #1

✓ answered by maxamis4

The closest thing I have ever heard that can do this for you is a streets and trip reference library that you can add to access. I am not sure how familiar you are with code but if you purchase streets and trips and add the library reference to access, it will allow you to access the streets and trips mapping library. who ever has a spread sheet basically created a distance address library, similiar to map quest, which uses arrays to determine total distance or a radius.

other than that I would search google for distance measurement databases.

5 5396
maxamis4
295 Expert 100+
The closest thing I have ever heard that can do this for you is a streets and trip reference library that you can add to access. I am not sure how familiar you are with code but if you purchase streets and trips and add the library reference to access, it will allow you to access the streets and trips mapping library. who ever has a spread sheet basically created a distance address library, similiar to map quest, which uses arrays to determine total distance or a radius.

other than that I would search google for distance measurement databases.
Apr 13 '07 #2
Widge
56
I did some conferring with a mate and he came up with this based on your advice. Needed:

1) ukpostcodes list tab (you'll have to find UK postcodes)
2) my suppliers list (with postcodes in column B)
3) tab called InsertCustomerPostcode

You then stick a formula in the suppliers list at the end of your data:
Expand|Select|Wrap|Line Numbers
  1. =SQRT(((ABS(VLOOKUP(TRIM(LEFT(InsertCustomerPostcode!$B$3,LEN(InsertCustomerPostcode!$B$3)-3)),'uk-postcodes'!$A$2:$C$2822,2, FALSE) -VLOOKUP(TRIM(LEFT(Suppliers!B2,LEN(Suppliers!B2)-3)),'uk-postcodes'!$A$2:$C$2822,2,FALSE)))^2)+((ABS(VLOOKUP(TRIM(LEFT(InsertCustomerPostcode!$B$3,LEN(InsertCustomerPostcode!$B$3)-3)),'uk-postcodes'!$A$2:$C$2822,3,FALSE)-VLOOKUP(TRIM(LEFT(Suppliers!B2,LEN(Suppliers!B2)-3)),'uk-postcodes'!$A$2:$C$2822,3, FALSE)))^2))/1609
all you need to do then is stick in a postcode in InsertCustomerPostcode B3 and then the lookups do their work.

Of course, now I need to find a way of getting this in Access and then restricting to x radius.
Apr 17 '07 #3
Widge
56
I now have this in a spreadsheet driven by a Userform. Is there any way of getting Access to interact with this at all?

Tried to think of a way to do what Excel is doing by using a query and Dlookups, but the complexity of it all caused a minor brain explosion.

Not entirely sure if what I was doing was possible. I was basically trying to get an amend query to perform the above calculation except with Access syntax like Dlookups and calculate distances when you input values into a form. You would have a textbox for inputting the postcode into, the query then uses the first part of the postcode to dlookup through the list of ukpostcodes, pulling off the location values etc... all what the above vlookups were doing basically. But so complicated to knock up in expression builder that I just couldn't get it to work.

So looking to see if I can find an easier way of doing things. Utilising something I know is working with my database (since I want to have everything running from one central point).

If you REALLY want to have a mess around with this, I can upload the UK Postcode file that I have and can give you a bit more of an indepth runthrough of what my setup is.
Apr 19 '07 #4
sm8082
1
Hi, do you this program written? and along with uk post code database?
Sep 15 '09 #5
Stewart Ross
2,545 Expert Mod 2GB
Hi sm8082. I doubt you will get an answer from an old thread (dating as it does from 2007). In any event, in the UK Royal Mail does not supply postcode databases for free. Although there are some royalty-free alternatives which try to provide similar data, including eastings and northings gathered on the ground by volunteers, there is simply no easy alternative to the data supplied commercially by Royal Mail (or by Ordnance Survey, which also uses Royal Mail data for the postcode and household information).

Unless posters use publically-available sources they would be in breach of copyright rules to publish UK postcode data sourced from Royal Mail or Ordnance Survey sources. We could not condone or assist in such illegal activities.

-Stewart
Sep 15 '09 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Bacci | last post by:
I'm creating a zip code radius search. I have a general understand of how this works, but am puzzled by how to get my final list of company locations. I have setup two database tables: one with...
1
by: nortelsale | last post by:
i have a site that allow people to post for sale, for rent info, I want to have advanced search function that can search all the posting (in my site) by zip code, and by certain miles say 10, 20...
2
by: Phil | last post by:
Hi. I have a table containing primary address, secondary address, road,town, postcode, there are otherfields within the table requestid, round, day, etc. I want to find all instances of the...
8
by: Steph | last post by:
Hi. I'm very new to MS Access and have been presented with an Access database of contacts by my employer. I am trying to redesign the main form of the database so that a button entitled...
3
by: Gary T. | last post by:
Another table called tbl_Customers has the following fields: JobNo (primary key) fkeyQuoteNo SiteName SiteAddr1 SiteAddr2 CompanyName CompanyAddr1 CompanyAddr2
5
by: momo | last post by:
Can anyone help me? I am writing an ASP.NET app. and I need to be able to have people search based on X radius of a zip code. Please help. Thanks, Momo
2
by: premgrps | last post by:
Hi, I have a database with two tables a) A table of 2 million records with city, zip and associated information (say XYZ) and b) zipcode latitude, longitude table having >40,000 records/zip...
1
by: Wayneyh | last post by:
Hello all I am trying to create a search form. I have a table called tblContact which has the field for postcodes in it. I have another table called tblSales which i have created a query to link...
10
by: Wayneyh | last post by:
Hello Everyone I have tblSales Which has CustomerID, Address1, Address2, Town, County, Postcode, Phone, DateOfVisit Fields and Paid chkbox. I have frmNewSales which is linked to tblSales. What...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.