Community of VE/MapPoint Users and Developers
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 ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Locating pushpin with partial name 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 |
| |||
|
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 & "*") 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? |
| ||||
|
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 |
![]() |
| Tags |
| locating, partial, pushpin |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| 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 |