Community of VE/MapPoint Users and Developers
This is a discussion on Balloon Confusion within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; I am mapping a few locations and I only want to display the pushpin.note. The location balloon also displays the ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Balloon Confusion Code: Sub MapSelectedProperties()
'Map the selected properties
On Error GoTo MapSelectedProperties_Err_Exit
Dim db As Database
Dim rstProps As Recordset
Dim objLoc As MapPoint.Location
Dim objMap As MapPoint.Map
Dim objPushpin As MapPoint.Pushpin
Dim strMsg As String
Dim i As Integer
i = 0
Set db = CurrentDb()
'Load the selected properties into a recordset
Set rstProps = db.OpenRecordset("SELECT * FROM tblProperties WHERE ysnSelected = Yes;")
'Make sure at least one property was selected
If rstProps.RecordCount > 0 Then
'Load Map
If LoadMap() Then
'Open the form containing the map
FormOpen "frmMap"
Set objMap = gappMP.ActiveMap
'Place a pushpin on the map for each selected property
While Not rstProps.EOF
i = i + 1
Set objLoc = objMap.FindAddressResults(rstProps!strStreet, rstProps!strCity, rstProps!strState, rstProps!strPostalCode)(1)
Set objPushpin = objMap.AddPushpin(objLoc, rstProps!strStreet)
objPushpin.Name = CStr(i)
objPushpin.Note = rstProps!curListPrice & " " & "Total Machines: " & rstProps!machinecount
objPushpin.BalloonState = geoDisplayBalloon
objPushpin.Symbol = 4
objPushpin.Highlight = True
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
MapSelectedProperties_Err_Exit:
On Error Resume Next
Set objPushpin = Nothing
Set objLoc = Nothing
Set objMap = Nothing
rstProps.Close
db.Close
Exit Sub
MapSelectedProperties_Err:
Resume MapSelectedProperties_Err_Exit
End Sub
Last edited by Wilfried; 10-22-2006 at 01:57 PM. |
| |||
| Re: Balloon Confusion
Hi, I'm not sure if I understeand what you ask. The display balloon displays the string you assign to it, no more and no less. So you loop trough a table and assign pushpin name and notes. That's what is displayed If I understeand wrong please explain again
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
| Re: Balloon Confusion
I didnt write the code I included but copied it from an existing program. The code works fine. The balloon currently displays the address, city and state. It also displays the note. I only want the note displayed and don't know which line of the code to remove. |
| |||
| Re: Balloon Confusion
Hi, Code: While Not rstProps.EOF
i = i + 1
Set objLoc = objMap.FindAddressResults(rstProps!strStreet, rstProps!strCity, rstProps!strState, rstProps!strPostalCode)(1)
Set objPushpin = objMap.AddPushpin(objLoc, rstProps!strStreet)
objPushpin.Name = CStr(i)
objPushpin.Note = rstProps!curListPrice & " " & "Total Machines: " & rstProps!machinecount
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
| Re: Balloon Confusion
Hi, Probably the name of the pushpin is the address. Your code does not show what is assigned to CStr. Comment out next line: Code: objPushpin.Name = CStr(i)
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
| Re: Balloon Confusion
Hi, Where is the attachment ?
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
![]() |
| Tags |
| balloon, confusion |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Information Balloon Color | Anonymous | MapPoint 2006/2009 Discussion | 0 | 03-31-2005 08:00 PM |
| Format balloon shape | johncon | MapPoint 2006/2009 Discussion | 1 | 02-16-2005 02:57 PM |
| Balloon Sizing and ZOrder | mmichaels | Wish List | 1 | 03-18-2004 04:45 PM |
| Balloon data display | marcus smith | MapPoint 2006/2009 Discussion | 1 | 01-17-2003 08:08 PM |
| balloon display | Anonymous | MapPoint 2006/2009 Discussion | 4 | 01-03-2003 04:15 PM |