PDA

View Full Version : Refresh After A Pushpin Has Been Deleted From the Dataset



Yazzy
09-15-2005, 05:06 AM
Hi

How can I refresh the map after a pushpin has been deleted from a dataset.

I need to display only the pushpins left in the dataset on the map.

I have to use 'ImportData' method and also using VB6.

Thanks in advance.

Wilfried
09-15-2005, 05:14 AM
Hi,

You can delete it like this:


pp = map.FindPushpin(ppName);
if (pp != null)
pp.Delete();

Yazzy
09-15-2005, 09:24 AM
Hi

I can delete the pushpin but I cannot refresh the map the new map to show the left Pushpins only

ID = "John Smith"
Set objPin = objMap.FindPushpin(ID)

objPin.Select
objPin.Delete
?? WHAT CODE TO REDRAW NEW DATASET (after a pushpin delete) map ???


What do I add after the last line 'objPin.Delete' to Redraw the map

Currently the deleted pushpin still appear on the map but not in the Dataset i.e "John Smith" does not appear when the Dataset test is done (see below for the dataset test code)


Set objDataSet = objMap.DataSets("New Set")

Set objRecordset = objDataSet.QueryAllRecords

Do Until objRecordset.EOF

MsgBox objRecordset.Pushpin.Name
objRecordset.MoveNext
Loop

:cry:

Thanks

Wilfried
09-15-2005, 02:04 PM
Hi,

The problem you have is probably because of the use of datasets. If you Add or Delete a PushPin it reflect immediatily on the map. So I suggest you forget DataSets (if that is the reason) and control the Pushpins yourself.