Community of MapPoint and Virtual Earth Users and Developers
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 ...
| |||||||
| Today's Posts | Twitter Feed | Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Adding pushpins and viewing map from access project 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 |
| |||
| 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. |
| |||
|
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
|
![]() |
| Tags |
| access, adding, map, project, pushpins, viewing |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| 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 |
Bodrum Holiday
Check out the picturesque towns on your Bodrum holiday... Book through UlookUbook!