Can some one help me with this access vba code please
I want it to add the waypoint (1) after the addpushpin(1)
I don’t know how to do this
Option Compare Database
Option Explicit
Private oMap As MapPoint.MappointControl
Private oCustomers As MapPoint.DataSet
Private objSA As MapPoint.StreetAddress
Private oPush As Pushpin
Private oLoc As Object
Private Sub cmdPlot_Click()
If txtAddress <> "" Then
ApplyPoint
End If
End Sub
Private Sub Form_Close()
oMap.ActiveMap.Saved = True
Set objSA = Nothing
Set oLoc = Nothing
Set oPush = Nothing
Set oMap = Nothing
End Sub
Private Sub Form_Load()
Set oMap = MapCtl.Object
oMap.NewMap geoMapEurope
txtAddress = "Me.txtpickupAddress"
End Sub
Public Function ApplyPoint()
If oMap Is Nothing Then Set oMap = Me!MapCtl.Object
Set objSA = oMap.ActiveMap.ParseStreetAddress(txtAddress)
Set oLoc = oMap.ActiveMap.FindAddressResults(objSA.Street, objSA.City _
, , objSA.Region, objSA.PostalCode)
If Not oLoc Is Nothing And oLoc.ResultsQuality <> geoNoResults Then
Set oPush = oMap.ActiveMap.AddPushpin(oLoc(1).Location, me.PickupCustomer)
oPush.BalloonState = geoDisplayName
oPush.Location.GoTo
Set oPush = Nothing
Set oLoc = Nothing
End If
End Function