Welcome to MapForums!

Register, sign in, or use Facebook Connect above to join in and participate in the forum.

When you are signed in, this message, the ads in this row, and the red-underlined link ads all go away.

Subscribe to receive our newsletter.
Subscribe Unsubscribe
Results 1 to 8 of 8

Balloon Confusion

This is a discussion on Balloon Confusion within the MapPoint Desktop 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 ...

  1. #1
    plevine1 is offline Junior Member Yellow Belt
    Join Date
    Jun 2006
    Posts
    16

    Balloon Confusion

    I am mapping a few locations and I only want to display the pushpin.note. The location balloon also displays the address. Any help would be great. I am using the following code:

    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.

  2. #2
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433

    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

  3. #3
    plevine1 is offline Junior Member Yellow Belt
    Join Date
    Jun 2006
    Posts
    16

    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.

  4. #4
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433

    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
    You loop here in a table. The last line is assigning different things to the pushpin's note. If you comment it then the note is empty, or change it so that it only contains the fields of the table you wants.

  5. #5
    plevine1 is offline Junior Member Yellow Belt
    Join Date
    Jun 2006
    Posts
    16

    Re: Balloon Confusion

    Thanks but I'm still confused. The note is what I want. I dont want to display the address. If I comment out the note then just the address will show in the balloon.

  6. #6
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433

    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)
    But I'm not sure you can have multiple pushpins with same name (or no name). But you can try.

  7. #7
    plevine1 is offline Junior Member Yellow Belt
    Join Date
    Jun 2006
    Posts
    16

    Re: Balloon Confusion

    Maybe the attached picture will explain my problem.

  8. #8
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Information Balloon Color
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 03-31-2005, 08:00 PM
  2. Format balloon shape
    By johncon in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 02-16-2005, 02:57 PM
  3. Balloon Sizing and ZOrder
    By mmichaels in forum Wish List
    Replies: 1
    Last Post: 03-18-2004, 04:45 PM
  4. Balloon data display
    By marcus smith in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 01-17-2003, 08:08 PM
  5. balloon display
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 4
    Last Post: 01-03-2003, 04:15 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


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 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96