Community of VE/MapPoint Users and Developers
This is a discussion on Capturing Pushpin movement within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; I have the same issue, but I'm working with Mappoint 2002 and VBA for MS Access 2000. In my database ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Capturing Pushpin movement Start Sub Snipet() If rstProps.RecordCount > 0 Then If LoadMap() Then FormOpen "frmMap" Set objMap = gappmp.ActiveMap While Not rstProps.EOF i = i + 1 Set objLoc = objMap.GetLocation(rstProps!Latitude, rstProps!_ Longitude) Set objPushpin = objMap.AddPushpin(objLoc, rstProps!LOCID) objPushpin.Name = rstProps!CompanyName objPushpin.Note = rstProps!HID objPushpin.Symbol = 0 rstProps.MoveNext Wend 'Show all pushpins on the map display objMap.DataSets.ZoomTo Else strMsg = "Unable to load map." MsgBox strMsg, vbOKOnly + vbExclamation, APP_NAME End If Else strMsg = "No properties selected." MsgBox strMsg, vbOKOnly + vbExclamation, APP_NAME End If End Sub Snipet -------------------------------------------------------------------------------- Function LoadMap() As Boolean On Error GoTo LoadMap_Err Set gappmp = CreateObject("MapPoint.Application") gappmp.Visible = False gappmp.PaneState = geoPaneNone ghwndMP = FindWindow(vbNullString, "Map - Microsoft MapPoint _ North America") FlipBit ghwndMP, WS_CAPTION, False LoadMap = True End Function It is at this point that the forms and map are finished loading, with the pins from the records that I pulled from the tblLocations. The frmMap's data source is tblLocations and has the four or five fields being displayed. As I click on the map I would like to update the from record to reflect the pin that I just clicked. ----------------------------------------------- In short I'm looking for something like: ------------------------------------------------ Onclick of objPushpin Get LOCID FindRecord in frmForm Where LOCID = Pushpin.LOCID ----------------------------------------------------------------- ------------------------------------------------------------------- I saw some of the below code and modified it a little. I'm not sure where to "put it" or even if this is getting me started in the right direction.: If I can get the LOCID into X as String I can recode to pass this to a FindRecod Method. Also objPushpin.Name = LOCID by the way. ---------------------------------------------------------------------------------- Private Sub MPC_BeforeClick(ByVal Button As Long, ByVal Shift As Long, ByVal X As Long, ByVal Y As Long, Cancel As Boolean) On Error Resume Next Dim oResults As MapPoint.Pushpin Dim X As String SetParent ghwndMP, Me.hwnd <---- I'm not sure if I need this. Set oResults = gappmp.ActiveMap.ObjectsFromPoint(X, Y) For Each oResult In oResults If TypeOf oResult Is Pushpin Then X = objPushpin.Name MsgBox (X) End If Next DoEvents End Sub ------------------------------------------------------------------------ All or any help is greatly appreciated in advance. |
![]() |
| Tags |
| capturing, movement, pushpin |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Capturing Mouse Wheel Event | Anonymous | MapPoint Web Service and Virtual Earth | 2 | 11-30-2005 08:31 AM |
| Capturing Pushpin movement | Anonymous | MapPoint 2006/2009 Discussion | 6 | 06-09-2003 06:37 PM |
| Finding Pushpin Name by clicking on the Pushpin?(MP 2002) | NickSP | MapPoint 2006/2009 Discussion | 4 | 01-10-2003 01:11 PM |