MapPoint Forums

MapForums

Community of MapPoint and Virtual Earth Users and Developers




Adding pushpins and viewing map from access project

This is a discussion on Adding pushpins and viewing map from access project within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; I am currently creating an Access project where we can click a button next to a customer record and it ...


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 09-18-2003
Senior Member
Green Belt
 
Join Date: Sep 2003
Posts: 103
Adding pushpins and viewing map from access project

I am currently creating an Access project where we can click a button next to a customer record and it will bring up a map of where there are and show our local stores.

So far i have it so that Access opens the map file in mappoint and then gets the handle of the map and puts it into another form (frmMap). This all works fine however the FindAddressResults and AddPushpin do not work, indeed they appear to do nothing!

I had this working previously but I was then required to OpenMap as we needed to use a previously worked on map rather than a blank one. Since putting in the OpenMap it hasn't worked.

I would be very gratefull for any ideas you may have.

Thanks in advance for your help.

Dazzer

This is the code I have currently as my OnClick event

Sub MapSelectedProperties()
'Map the selected properties
On Error GoTo MapSelectedProperties_Err_Exit

Dim objLoc As MapPoint.Location
Dim objMap As MapPoint.Map
Dim objPushpin As MapPoint.Pushpin


Dim PCode As String
Dim strMsg As String

Set gappMP = CreateObject("MapPoint.Application")
gappMP.OpenMap ("Q:\BellsMapTest\Bells.ptm")
gappMP.Visible = True
gappMP.PaneState = geoPaneNone

'Get the handle of the MapPoint Window
ghwndMP = FindWindow(vbNullString, "Bells.Ptm - Microsoft MapPoint Europe")
'Remove MapPoint Title Bar
FlipBit ghwndMP, WS_CAPTION, False
'Open the form containing the map
FormOpen "frmMap"


PCode = Left(Me!PostCode, 5)
'Place a pushpin on the map for each selected property
Set objLoc = objMap.FindAddressResults(Me!Street, Me!Village, Me!Town, , PCode)(1)
Set objPushpin = objMap.AddPushpin(objLoc, Me!Street)
objPushpin.Name = Me!Street
objPushpin.Note = Me!Forenames & " " & Me!Surname
objPushpin.BalloonState = geoDisplayBalloon
objPushpin.Symbol = 77
objPushpin.Highlight = True


'Show all pushpins on the map display
objMap.DataSets.ZoomTo


MapSelectedProperties_Err_Exit:
On Error Resume Next
Set objPushpin = Nothing
Set objLoc = Nothing
Set objMap = Nothing

Exit Sub
MapSelectedProperties_Err:
MsgBox Err.Description
Resume MapSelectedProperties_Err_Exit
End Sub
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 11-06-2003
Junior Member
White Belt
 
Join Date: Nov 2003
Posts: 4
Adding pushpins and viewing map from access project

I'm having the same problem with OpenMap. If I only use a Create Object I get a new map and it loads to a MSAccess form. If I use the OpenMap to select a map that I have updated or worked on
ie: "C:\anydirectory\any.ptm" Mappoint starts a new instance outside of the MSAccess Application that I'm running. If anyone has any solutions or links to code that would solve this problem it would be greatly appreciated.
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 11-07-2003
Senior Member
Green Belt
 
Join Date: Sep 2003
Posts: 103
I solved this problem, my mistake was using OpenMap, I should have used NewMap

Code:
Dim gappmp As New Mappoint.Application
 Dim objMap As MapPoint.Map

  Set gappmp = CreateObject("MapPoint.Application")
  
    gappmp.NewMap "C:\AMap.ptm"
    gappmp.Visible = False
    'gappmp.UserControl = True
    gappmp.PaneState = geoPaneNone

    Set objMap = gappmp.ActiveMap
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
access, adding, map, project, pushpins, viewing


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
Adding Pushpins from Excel 2003 Marktherob MapPoint 2006/2009 Discussion 2 02-07-2006 05:13 PM
Adding pushpins by lat/long or address using MPC in MSAccess GM MapPoint 2006/2009 Discussion 0 11-01-2004 12:00 PM
Adding custom pushpins to the pushpin selection Anonymous MapPoint 2006/2009 Discussion 1 11-28-2003 03:28 PM
Adding Pushpins Matrices MapPoint 2006/2009 Discussion 1 11-28-2003 10:32 AM
Is there a fast way of adding pushpins? matt1168 MapPoint 2006/2009 Discussion 3 07-24-2003 09:44 AM


All times are GMT -5. The time now is 06:03 AM.


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

Bodrum Holiday
Check out the picturesque towns on your Bodrum holiday... Book through UlookUbook!



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