Community of VE/MapPoint 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 ...
| |||||||
| 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 |
Ski Packages
Book stunning ski packages online at Holiday Hypermarket. Don't miss out on the range of great deals on offer from leading travel brands.
Best Travel Agent
Travel Counsellors was recently voted the UK's Best Travel Agent at the Guardian Unlimited travel awards. Book your travel with an award winning travel agent.
Flights to Cape Town
Before booking flights to Cape Town visit dealchecker.co.uk to make sure you are getting the best deal in town. Visit online today and try the holiday search for free.
Holidays to Bahamas
Choose from a number of extraordinary holidays to the Bahamas at The Holiday Place. See pictures of these beautiful islands online.
Canaries
Find out all about the Canaries when you check out the ulookubook.com travel guides. Not only can you get a great holiday deal but you can find out useful information about potential holiday destinations.
Cheap Travel
For cheap travel options, visit Travel.co.uk and explore the benefits of our comparison site.
Cheap Holidays to Florida
Cash strapped? Get info on cheap holidays to Florida at On The Beach.