htamraz1
asked on
Using Access form to create a Mappoint 2013 data map
Hello,
I have a form with five fields that is bound to a table "tblMappoint". I have button on the form that when pressed should open Mappoint and plot the data points using address, city, state, and zip. I am getting a VBA compile error: Method of data member not found on the line "rs.Edit". Any help in resolving this would be appreciated.
========================== ========== ========== =====
Here is the fields in the table
========================== ========== ========== =====
ID = PK
Address = short text
City = short text
State = short text
Zip = short text
========================== ========== ========== =====
Here is the code behind the button
========================== ========== ========== =====
Dim APP As MapPoint.Application
Private Sub Geocode_Click()
Dim MAP As MapPoint.MAP
Dim FAR As MapPoint.FindResults
Dim LOC As MapPoint.Location
Set APP = CreateObject("MapPoint.App lication")
APP.Visible = True
Set MAP = APP.ActiveMap
Dim rs As Recordset
Set rs = CurrentDb.OpenRecordset("S ELECT * FROM tblMappoint")
Do Until rs.EOF = True
Set FAR = MAP.FindAddressResults(rs( "Address") , rs("City"), , rs("State"), rs("Zip"))
Set LOC = FAR(1)
rs.Edit
rs!MP_Latitude = LOC.Latitude
rs!MP_Longitude = LOC.Logitude
rs!MP_MatchedTo = GetGeoFieldType(LOC.Type)
rs!MP_Quality = GetGeoQuality(FAR.ResultsQ uality)
rs!MP_Address = LOC.StreetAddress.Value
rs.Update
rs.MoveNext
Loop
End Sub
I have a form with five fields that is bound to a table "tblMappoint". I have button on the form that when pressed should open Mappoint and plot the data points using address, city, state, and zip. I am getting a VBA compile error: Method of data member not found on the line "rs.Edit". Any help in resolving this would be appreciated.
==========================
Here is the fields in the table
==========================
ID = PK
Address = short text
City = short text
State = short text
Zip = short text
==========================
Here is the code behind the button
==========================
Dim APP As MapPoint.Application
Private Sub Geocode_Click()
Dim MAP As MapPoint.MAP
Dim FAR As MapPoint.FindResults
Dim LOC As MapPoint.Location
Set APP = CreateObject("MapPoint.App
APP.Visible = True
Set MAP = APP.ActiveMap
Dim rs As Recordset
Set rs = CurrentDb.OpenRecordset("S
Do Until rs.EOF = True
Set FAR = MAP.FindAddressResults(rs(
Set LOC = FAR(1)
rs.Edit
rs!MP_Latitude = LOC.Latitude
rs!MP_Longitude = LOC.Logitude
rs!MP_MatchedTo = GetGeoFieldType(LOC.Type)
rs!MP_Quality = GetGeoQuality(FAR.ResultsQ
rs!MP_Address = LOC.StreetAddress.Value
rs.Update
rs.MoveNext
Loop
End Sub
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks to both of you. Adding DAO did resolve the previous error; however, I have a compile error on two missing functions -- GetGeoFieldType and GetGeoQualityare.
FYI, I am adapting the code found here
http://www.mapforums.com/access-vba-programming-part-i-geocoding-mappoint-28228.html
Where would I find the these two helper functions referenced in the code:
GetGeoFieldType and GetGeoQualityare
I need them for the code to compile correctly.
Thank you again.
FYI, I am adapting the code found here
http://www.mapforums.com/access-vba-programming-part-i-geocoding-mappoint-28228.html
Where would I find the these two helper functions referenced in the code:
GetGeoFieldType and GetGeoQualityare
I need them for the code to compile correctly.
Thank you again.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I think you're right. I posted a message on his forum to see what he has to say. I am comfortable closing the loop on this post, but let me wait for a day or so before I do that just in case he replies and I can add that to the post.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I had to research the solution for the final part of the problem
From the VBA editor:
Tools --> References
Check the box for the Microsoft DAO Object Library
Click OK to save and exit the references dialog.