View Single Post

  #1 (permalink)  
Old 06-04-2006
nmilne nmilne is offline
Junior Member
White Belt
 
Join Date: Jan 2006
Posts: 9
help on converting vba code to visaul basic 2005 express


Can someone help me please convent this vbaccess mappoint 2004 code to visual basic 2005 code as im trying to convert my database to visual basic 2005 express edition many thanks if you can help me



Code:
Option Compare Database

Private objMap As MAPPOINT.MappointControl
Private objRoute As MAPPOINT.Route
Private objSA As MAPPOINT.StreetAddress
Private objPush As Pushpin
'Private objway As Waypoints
Private oLoc As Object


Private Sub cmdPlot_Click()
    If txtAddress <> "" Then
        ApplyPoint
    End If
End Sub


Private Sub Form_Load()
    Set objMap = Mapctl.Object
    objMap.NEWMAP geoMapEurope
End Sub


Public Function ApplyPoint()

    If objMap Is Nothing Then Set objMap = Me!Mapctl.Object
    Set objSA = objMap.ActiveMap.ParseStreetAddress(PICKUPADDRESS & " , " & PICKUPTOWN & " , " & PICKUPCOUNTY & " , " & PICKUPPOSTCODE)
    Set oLoc = objMap.ActiveMap.FindAddressResults(objSA.Street, objSA.City _
     , , objSA.Region, objSA.PostalCode)
     
    If Not oLoc Is Nothing And oLoc.ResultsQuality <> geoNoResults Then
    
        Set objPush = objMap.ActiveMap.AddPushpin(oLoc(1).Location, Me.PICKUPCUSTOMER)
        objPush.BalloonState = geoDisplayName
        objMap.ActiveMap.ActiveRoute.Waypoints.Add oLoc(1) 'Adds Awaypoint to map
        objPush.Location.GoTo
        Set objPush = Nothing
        Set oLoc = Nothing
    End If

End Function
Reply With Quote