From: Steve on
Hi,

I have a form in an access database with a Mappoint control in it. I would
like to
set the controls dataset to be that of either a query or table in the
database but am struggling.

I can currently set the dataset to be that of the spreadsheet that was the
original datasource for my access db, but would obviously rather source the
data for the map from my database so I could narrow the query results or
table contents.

This is my code now - which works, but I need to amend to pick up either a
table in my database called Postcodes or a query.. preferably a query.

How do I amend the line that sets what sTarget is to do that?



Private Sub Form_Load()


Dim oDS As MapPoint.DataSet
Dim sTarget As String

MappointControl1.NewMap geoMapEurope

Set mymap = MappointControl1.ActiveMap

With mymap.DataSets

sTarget = "Q:\Analyses\Arrears Analysis\Data.xls"

Set oDS = .LinkData(sTarget, "Postcode", , , geoCountryUnitedKingdom,
geoImportExcelA1)

End With

mymap.DataSets.ZoomTo


End Sub

--
Regards,

Steve

--
Regards,

Steve