mappoint activex control for vba

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Anyone got a url where I can obtain the mappoint activex control for vba????
 
Thanks for your reply Tom. I have mappoint installed and have registered the
control in access. The control appears in the list of available controls but
when I attempt to place the control on a form, the control is their in design
view but not when the form is opened. Any idea???
 
Hi Joe,

In form design view, select the MapPoint ActiveX control. Then press the F1
key to open context-sensitive Help. You should be able to find a lot of
information to get you started. For example, I found the following in the
Help file:

By default, the Control opens with no map open and with no additional
border. If you do not call NewMap or OpenMap, the Control may appear
invisible on your form when you first open it. This is expected behavior
because the Control does not have a map to display. If you want to see the
Control even when there is no map open, you can change its BorderStyle and
Appearance properties to change how it is displayed.

To help get you started, try the following Form_Load event procedure, where
"MappointControl1" is the name of the ActiveX control (you can substitute a
different name as well):

Option Compare Database
Option Explicit

Sub Form_Load()
MappointControl1.NewMap geoMapNorthAmerica
End Sub


Tom Wickerath
Microsoft Access MVP

http://www.access.qbuilt.com/html/expert_contributors.html
http://www.access.qbuilt.com/html/search.html
__________________________________________
 
PS.

Search your hard drive for a Help file named Mappoint.chm. The last entry on
the Contents tab reads "Programming Information". Here is an example that
uses late bound code, to instantiate MapPoint as a seperate application (ie.
not using the ActiveX control on a form). You might find this method more to
your liking, because it allows you to trap and gracefully handle error 426,
in the event that a user does not have MapPoint installed:

Option Compare Database
Option Explicit

Dim objApp As MapPoint.Application
Dim objMap As MapPoint.Map

Private Sub Form_Load()
'Set up the application
Set objApp = CreateObject("mappoint.application")
Set objMap = objApp.ActiveMap
objApp.Visible = True
objApp.UserControl = True
End Sub

Private Sub Command1_Click()
'Pan the map
objMap.Pan geoNorth
End Sub


Note:
The example from the Help file actually included this:

Dim WithEvents objApp As MapPoint.Application
Dim WithEvents objMap As MapPoint.Map

but these declarations result in a compile error in Access. I removed the
WithEvents, and the code compiled (and ran) just fine.


Tom Wickerath
Microsoft Access MVP

http://www.access.qbuilt.com/html/expert_contributors.html
http://www.access.qbuilt.com/html/search.html
 
Oops. My mistake. The code I showed below, from the Mappoint.chm Help file,
is early bound code (ie. requires a checked reference). To convert this code
to late bound code, which does not require that a referece be set, make the
following changes:

Change:
Dim objApp As MapPoint.Application
Dim objMap As MapPoint.Map

To:
Dim objApp As Object
Dim objMap As Object

and change:

objMap.Pan geoNorth to objMap.Pan 8

in the Command1_Click event procedure.


Tom Wickerath
Microsoft Access MVP

http://www.access.qbuilt.com/html/expert_contributors.html
http://www.access.qbuilt.com/html/search.html
 
Hi Tom
thanks for your response
to my postings. Unfortunately
I am away this week and will follow up your suggestions on my return.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top