Free UK Postcode Lookup - revisited (1 Viewer)

Michael Stroud

New member
Local time
Today, 12:46
Joined
Jul 28, 2012
Messages
2
Hi,
Last year r.harrison helpfully posted a great solution to UK postcode lookup which works for domestic addresses. However it omits the business addresses which appear further down the returned web page if you search using a postcode with businesses. Can anyone help with getting the extra information into the same listbox as the domestic addresses.
Michael Stroud

PS I cant post the link or even the vba code as it includes 'http' and I have not already posted to this forum 10 times. However, you can find the thread by searching the forum for 'Free UK Postcode Lookup'.
 
That seems to work, though the data in the list box is out of sync, but if you are going to assign each element of the address to different variables and or form fields you should be able to pick them up from this. There may well be a more elegant way of acheiving, but it works (with limited testing).
 

Attachments

Thanks a million. Brilliant and well beyond my skill set.
Incidentally I have the user click a record in the listbox and then copy the data to a contact data entry form. This will save a significant number of man hours as I am helping a fast growing charity (for free).
Michael
 
Just seen this thread and thought this might interest someone, postcodewise gives you free plugin for your website an allows free postcode lookup i can't post the link here just search postcodewise on google.
 
Hi there,

This is a great tool. unfortunatly its doesnt work with all postcodes, infact out of 30 Postcodes I tried only 11 worked.

Any ideas?
 
The DB looks the post codes up on http://www.192.com/places/

Terms and Conditions:-
If I register what do I see/get?
When you register for free on 192.com you will get up to 20 searches per day and be able to see the name, address and telephone number of the person or business you searched for.

I don't know if that limit applies to post code search, I guess it would as they need to produce an income.

So have you signed up and paid?
 
Last edited:
Hi,
I modded this code for my own needs and until recently it has been working fine. The code simple scans each line of the source of the webpage and looks for specific HTML tags. It then simply parses the address from that line and, in my case adds it to a table for further interrigation. This procedure has nothing to do with the website registration, the text in the source document is free to use and has no restrictions.

It ceased to work correctly in my modded code because they (192.com) have updated the source code for the website and those specific HTML tags have been amended. I beleive they have done this to accomodate for the "mobile" market because the addresses on the website now appear in the following format:

Code:
[COLOR=#0000ff]<[/COLOR][COLOR=#800000]td[/COLOR][COLOR=#ff0000]class[/COLOR][COLOR=#0000ff]="js-ont-full-address ont-hidden-on-smaller-than-tablet">[/COLOR]  address goes here with no quotation marks   [COLOR=#0000ff]</[/COLOR][COLOR=#800000]td[/COLOR][COLOR=#0000ff]>[/COLOR]

So to get the code working you need to change the "if instr" line to read:

Code:
If InStr(I, "td class='js-ont-full-address ont-hidden-on-smaller-than-tablet'>") > 0 Then
                I = Replace(I, "td class='js-ont-full-address ont-hidden-on-smaller-than-tablet'>", "")

Hope this is clear enough :)

BTW it took me an age to figure out that the leading "<" character was removed from each line.
 
Hi,
I modded this code for my own needs and until recently it has been working fine. The code simple scans each line of the source of the webpage and looks for specific HTML tags. It then simply parses the address from that line and, in my case adds it to a table for further interrigation. This procedure has nothing to do with the website registration, the text in the source document is free to use and has no restrictions.

It ceased to work correctly in my modded code because they (192.com) have updated the source code for the website and those specific HTML tags have been amended. I beleive they have done this to accomodate for the "mobile" market because the addresses on the website now appear in the following format:

Code:
[COLOR=#0000ff]<[/COLOR][COLOR=#800000]td[/COLOR][COLOR=#ff0000]class[/COLOR][COLOR=#0000ff]="js-ont-full-address ont-hidden-on-smaller-than-tablet">[/COLOR]  address goes here with no quotation marks   [COLOR=#0000ff]</[/COLOR][COLOR=#800000]td[/COLOR][COLOR=#0000ff]>[/COLOR]

So to get the code working you need to change the "if instr" line to read:

Code:
If InStr(I, "td class='js-ont-full-address ont-hidden-on-smaller-than-tablet'>") > 0 Then
                I = Replace(I, "td class='js-ont-full-address ont-hidden-on-smaller-than-tablet'>", "")

Hope this is clear enough :)

BTW it took me an age to figure out that the leading "<" character was removed from each line.

thanks, that got it working for me.

Next issue is how to I assign the selected values into text boxes?

If i use list.value I just get the value from the first column, if I use the variables add1 add2 etc from the vba, they dont relate to the selected values in the list, just the first ones on the list. Any ideas?
 
4 year old thread?

As we know, Access doesnt seem to change much lol.

Im going to answer my own question to help others:

to get the listed values in each column, you can use code like this

Me.Text5 = Me.List2.Column(0) & " " & Me.List2.Column(1)
 

Users who are viewing this thread

Back
Top Bottom