MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Locating pushpin with partial name

This is a discussion on Locating pushpin with partial name within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; I have a set of pushpins in a map which each have a name that follows the format " a ...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-21-2003
Senior Member
Green Belt
 
Join Date: Sep 2003
Posts: 103
Locating pushpin with partial name

I have a set of pushpins in a map which each have a name that follows the format "a number & some text"

In my vb application then have a list of all pushpins in a listbox, the list box contains the number part of the pushpin name.

what i would like to happen is when the user selects a number from the listbox the appropriate pushpin is then selected in mappoint

I have the following code

Dim objPin As MapPoint.Pushpin
Dim objMap As MapPoint.Map
Dim gappmp as Mappoint.application

Set objMap = gappmp.ActiveMap

Set objPin = objMap.FindPushpin(Me!listbox)
objPin.Select


Where Me!listbox is the listbox on my vb form. However as the listbox only contains the number part of the pushpin name (and this is all it will ever hold, i don't wish to change this) it can't find the pushpin as it is clearly looking for the whole name.

I would like to know is it possible to find a pushpin based only on part of the name, instead of the whole name.

I would be very grateful for any help.

Dazzer
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 10-21-2003
Member
Yellow Belt
 
Join Date: Sep 2003
Posts: 44
how about :

Code:
Set objPin = objMap.FindPushpin("other_text" & Me!listbox)
M
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 10-21-2003
Senior Member
Green Belt
 
Join Date: Sep 2003
Posts: 103
That would work however I really need it to find the pushpin based purely on the number in the list box

For example if I have a pin with the name "23 MrANOther"

And the listbox (or combo box I have yet to decide) contains the values
1
12
23
34
54

When the user selects 23 I would then like the pin that contans 23 to be selected.

The problem really occured when the map was set up (not by me) each pin should have contained the number in the name field and nothing else, the text should have then gone in the notes. As there are about 200 pins I don't really have the time to go through each one and correct this.

Is there something like * which might work
e.g.
Code:
Set objPin = objMap.FindPushpin(Me!listbox & "*")
This doesn't apear to work but is there something I can do along these lines.

Or perhaps there is something I can do with FindResults or though i have no idea what? Lets face it, I think i'm going to have to go through each pin and rename them aren't I?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 10-22-2003
Member
Yellow Belt
 
Join Date: Sep 2003
Posts: 44
Not too sure then tbh, i'm not too hot with excel, but if you export all your pins to excel, maybe you can find a quick way of separating the numbers from the text then re-import the data into mappoint

M
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5 (permalink)  
Old 10-24-2003
John Meyer's Avatar
Senior Member
Blue Belt
 
Join Date: Jul 2002
Posts: 479
As far as I know you can not use a partial string match with the find pushpin method.

You could loop thru your pushpins and do a instr.

Code:
Dim objmap As MapPointCtl.Map
Set objmap = MappointControl1.ActiveMap
Dim objDataSet As MapPointCtl.DataSet
Dim objRecords As MapPointCtl.Recordset


Set objDataSet = objmap.DataSets("My Pushpins")
Set objRecordset = objDataSet.QueryAllRecords

Do While Not objRecordset.EOF
 If InStr(1, objRecordset.Pushpin.Name, "test", vbTextCompare) Then
    MsgBox objRecordset.Pushpin.Name
 End If
objRecordset.MoveNext
Loop
__________________
John
http://www.support-pc.com

Order MapPoint 2006 Here
https://secure.mp2kmag.com/?refer=support-PC
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6 (permalink)  
Old 10-27-2003
Senior Member
Green Belt
 
Join Date: Sep 2003
Posts: 103
Thanks that done the job, saved me a hell of a lot of work too!!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
locating, partial, pushpin


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
Find fails with full install but not partial Tony Kobine MapPoint 2006/2009 Discussion 0 08-19-2005 04:50 AM
Street names: partial matching apravettoni MapPoint 2006/2009 Discussion 6 06-22-2005 03:56 PM
Locating the name of a Shape selected Anonymous MapPoint 2006/2009 Discussion 4 04-30-2004 05:57 AM
Pl.. Help ----Locating/ placing positions in India Anonymous MapPoint 2006/2009 Discussion 0 11-13-2003 03:20 AM
Can you pinpoint with a partial postcode? Anonymous MapPoint 2006/2009 Discussion 0 10-03-2002 03:13 AM


All times are GMT -5. The time now is 11:07 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
MP2K Magazine
Visitor Map


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