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 5 of 5

pushpin event in vba access

This is a discussion on pushpin event in vba access within the MapPoint Desktop Discussion forums, part of the Map Forums category; Hi, i'm trying to connect access2000 and mappoint 2004 with vba. In my Mappoint are pushpins with customer Id numbers ...

  1. #1
    mimo123 is offline Junior Member White Belt
    Join Date
    Jul 2005
    Posts
    3

    pushpin event in vba access

    Hi,

    i'm trying to connect access2000 and mappoint 2004 with vba.
    In my Mappoint are pushpins with customer Id numbers from access.
    When i click on the pushpin, i would be happy if i could somehow detect this in access and read out the customer id to open a formular with this customer in access.

    thanks

    mimo123

  2. #2
    John Meyer's Avatar
    John Meyer is offline Senior Member Blue Belt
    Join Date
    Jul 2002
    Posts
    478
    For this example: in access add an activex object (Microsoft MapPoint Control 11.0) to form1 and add this code. Run the form and add a pushpin from the drawing toolbar. add a shape from the drawing toolbar. Select different items. When you select the pushpin the message box appears. Hope this helps...

    Code:
    Option Compare Database
    Dim objMap As MapPoint.Map
    Dim objPin As MapPoint.Pushpin
    
    Sub Form_Load()
    Set objMap = MappointControl1.NewMap(geoMapNorthAmerica)
      MappointControl1.Toolbars.Item("Navigation").Visible = True
    MappointControl1.Toolbars.Item("Drawing").Visible = True
    
    End Sub
    
    Private Sub MappointControl1_SelectionChange(ByVal pNewSelection As Object, ByVal pOldSelection As Object)
    
    If TypeOf pNewSelection Is Pushpin Then
        
            MsgBox pNewSelection.Name
            
        End If
    End Sub

  3. #3
    mimo123 is offline Junior Member White Belt
    Join Date
    Jul 2005
    Posts
    3
    Thanks,

    i tried several times to insert mappoint control 11 to form1 and to add your code.
    It doesn't work. When i open the form the error "objekt is missing" and when i click into the activex in the form error "ols server is not installed"
    So i tried some other things. No succes.
    But in the mappoint helpfile mappoint control 11 is only for vb not vba.

    Can I get the selectionchange event in a mappoint application running "free"?

    thanks
    mimo123

  4. #4
    calv1ns's Avatar
    calv1ns is offline Member Green Belt
    Join Date
    Mar 2005
    Posts
    91

    Try this...

    Hey mimo

    If I understand your problem maybe try this:

    Open the Module in Access that contains the code John gave you. Then in the VBA Editor Click:

    Tools> References...

    Search through the list and select:

    Microsoft MapPoint 11.0 Object Library (North America)

    If it is not in the list, browse for the file:

    C:\Program Files\Microsoft MapPoint\MPNA82.tlb

    Note change the drive and directory to suit where you installed MP 2004.

    Hope this helps
    Ciao,
    Calv1ns

  5. #5
    mimo123 is offline Junior Member White Belt
    Join Date
    Jul 2005
    Posts
    3
    Thanks calv1ns,

    re-thought your tip and checked, the mappoint library was installed.
    The problem seem's to be, that Microsoft MapPoint Control 11.0 is only working in vb not in vba (checked again in online help).

    Has anyone an idea, how i can teach access to recognise selectionChange events in vba?

    Thanks and nice weekend
    mimo

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. SelectionChange event
    By Yazzy in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 05-16-2006, 10:25 AM
  2. Where is the Quit event?
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 04-08-2005, 08:36 AM
  3. Event get called when pushpin is deleted
    By vidyakulkarni in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 10-25-2004, 10:43 PM
  4. Capture the Pushpin move event
    By Maverick in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 04-14-2003, 02:34 AM
  5. VB6 + ACCESS : Center to a pushpin and other things...
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 09-05-2002, 11:40 AM

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