View Single Post

  #1 (permalink)  
Old 12-16-2003
starbuck's Avatar
starbuck starbuck is offline
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
Reply With Quote