MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




lat lon from uk postcode

This is a discussion on lat lon from uk postcode within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hi I am trying to get the lat lon from a given postcode using the following routine in VB6 Private ...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-16-2003
starbuck's Avatar
Member
Green Belt
 
Join Date: Oct 2003
Posts: 68
lat lon from uk postcode

Hi

I am trying to get the lat lon from a given postcode using the following routine in VB6

Private Sub mapBtn_Click()

Dim oMap As MapPoint.Map
Dim oLoc As MapPoint.Location

On Error GoTo er
If Len(Postcode_txt) = 0 Then Exit Sub
Set oMap = New MapPoint.Map '.ActiveMap
Set oLoc = oMap.FindAddressResults("", "", "", "", Postcode_txt, geoCountryUnitedKingdom)
CalcPos oMap, oLoc, maplat, maplon

Exit Sub
er:
MsgBox Str(Err) + SP + Err.Description

End Sub


My problem is the line
Set oLoc = oMap.FindAddressResults("", "", "", "", Postcode_txt, geoCountryUnitedKingdom)

generates error 13, type mismatch

Any ideas folks
Thanks in advance
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 12-16-2003
John Meyer's Avatar
Senior Member
Blue Belt
 
Join Date: Jul 2002
Posts: 479
your problem might be that "maplat, maplon" need to be declared as Double for the calcpos sub.
__________________
John
http://www.support-pc.com

Order MapPoint 2006 Here
https://secure.mp2kmag.com/?refer=support-PC
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 12-16-2003
starbuck's Avatar
Member
Green Belt
 
Join Date: Oct 2003
Posts: 68
ok, done it, this is how

Private Sub mapBtn_Click()

Dim objApp As New MapPoint.Application
Dim objMap As MapPoint.Map
Dim objLoc As MapPoint.Location

Set objMap = objApp.ActiveMap
objApp.Visible = False
objApp.UserControl = True


On Error GoTo er
If Len(Postcode_txt) = 0 Then Exit Sub
'Find an address
Set objLoc = objMap.FindAddressResults(, , , , Postcode_txt.Text, geoCountryUnitedKingdom)(1)
CalcPos objMap, objLoc, maplat, maplon
Exit Sub
er:
MsgBox Str(Err) + SP + Err.Description

End Sub



cool ehh!!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
lat, lon, postcode


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
need help in entering quaintly against postcode tony jones MapPoint 2006/2009 Discussion 3 08-04-2004 07:37 AM
Full UK Postcode Anonymous MapPoint 2006/2009 Discussion 2 03-15-2004 10:46 AM
POSTCODE gsc1ugs MapPoint 2006/2009 Discussion 0 02-06-2003 09:20 AM
Postcode Formatting.. David MapPoint 2006/2009 Discussion 0 08-30-2002 06:33 AM
UK postcode mapping problems Robin MapPoint 2006/2009 Discussion 1 08-08-2002 08:09 AM


All times are GMT -5. The time now is 11:04 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
MP2K Magazine
Visitor Map


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55