I'm trying to use MPC in an access database form that will allow me to add a pushpin by either lat/longs or if these fields are null, by address. The code I'm using is shown below but I keep getting an error message on the addpushpin line.

Could anyone provide a working solution to this problem?

Private Sub Form_Current()

Dim oMap As MapPoint.map
Dim oLoc As MapPoint.location

' If objMap.DataSets(1) <> Null Then
On Error Resume Next
On Error GoTo 0
' End If

Set oMap = MPC.NewMap(geoMapNorthAmerica)
MPC.Toolbars.Item("Standard").Visible = True
MPC.Toolbars.Item("Navigation").Visible = True
oMap.Application.Units = geoMiles

If (Me!Latitude) = Null Then
Set oLoc = oMap.FindAddressResults(Me![Address1], Me![City], , Me![prov], Me![Country])(1)

ElseIf (Me!Latitude) <> Null Then
Set oLoc = oMap.AddPushpin(oMap.GetLocation(Me!Latitude, Me!Longitude, 100))

End If

oMap.AddPushpin oLoc
Symbol = 82

End Sub