MapPoint Forums

MapForums

Community of MapPoint and Virtual Earth Users and Developers




VBA calling MP2k2

This is a discussion on VBA calling MP2k2 within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; I am trying to give the ability to my user to look up a record in an access form, click ...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

Today's Posts Twitter Feed Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-14-2003
Junior Member
White Belt
 
Join Date: Jan 2003
Posts: 2
Send a message via MSN to rkehn
VBA calling MP2k2

I am trying to give the ability to my user to look up a record in an access form, click a button and the load the map with that records address. It works fine yet when they switch to a new record and hit the map button again this new adress does goes on the original map, yet another mappoint windows loads. So now I have the two map point windows open the original with two pins and another that is just blank USA. And so on and so forth... 3 different records mapped - 3pins on orig map now two extra windows of map point. I beleive it is my code calling the new window but i just want each new recoard to go onto one map.

Is there a peice of code that will just add a new pin to the current map.
How might I referance the original windows/object
I am not using datasets because I done know what records the user might choose.

Thanks in advance, Roger

Here is my code that will run every time the user switches to a new record clicks the map button on the form.

**************Code*************************




Dim MPApp As MapPoint.Application
Set MPApp = CreateObject("MapPoint.Application")
Set omap = GetObject(, "MapPoint.Application").ActiveMap
Dim oLoc As MapPoint.Location
Dim oPin As MapPoint.Pushpin
Dim StreetAdr As String

StreetAdr = Me.delivDayAddress + "," + Me.delivDayZip

omap.FindResults(StreetAdr)(1).Goto
Set oLoc = omap.FindAddressResults(Me.delivDayAddress, , , , Me.delivDayZip)(1)
Set oPin = omap.AddPushpin(oLoc)
oPin.Name = [Forms]![LogCustomer]![FirstName] & " " & [Forms]![LogCustomer]![LastName]
oPin.BalloonState = geoDisplayBalloon
oPin.Note = Me.delivDayPhone
oPin.Symbol = 25

MPApp.WindowState = geoWindowStateMaximize
MPApp.UserControl = True
MPApp.ActiveMap.Saved = True
MPApp.Visible = True
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 01-15-2003
John Meyer's Avatar
Senior Member
Blue Belt
 
Join Date: Jul 2002
Posts: 479
Roger,

On the first go around, MapPoint is not running yet so this part of your code is needed

Set MPApp = CreateObject("MapPoint.Application")

If MapPoint is running already this line of code starts another copy.
__________________
John
http://www.support-pc.com

Order MapPoint 2006 Here
https://secure.mp2kmag.com/?refer=support-PC
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 01-15-2003
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
Thanks but one quick question

Is there a line of code that can see if it is already loaded once?

Thanks again for the quick responce!

Rog
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
calling, mp2k2, vba


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads

Thread Thread Starter Forum Replies Last Post
Calling all Micro-ISVs! Winwaed General Chat 2 05-05-2006 11:16 AM
AGPS in MP2k2 shows wrong long/lat but yet plots correct pos Jamez_Warner MapPoint 2006/2009 Discussion 1 06-17-2003 09:18 AM
911 outbound calling LLurie MapPoint 2006/2009 Discussion 4 04-21-2003 09:41 AM
mp2k2 Fleet Applications Clyde MapPoint 2006/2009 Discussion 2 01-11-2003 08:48 PM
I wonder if there is a way to import MP2k2 data in.... Anonymous MapPoint 2006/2009 Discussion 1 08-20-2001 07:34 AM


All times are GMT -5. The time now is 11:50 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0 RC2
MP2K Magazine
Visitor Map

Antalya Holiday
Check out the Antalya holiday options through UlookUbook and find amazing offers that suit your pocket...



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59