Tracking P.F. Chang’s in the Midwest

Anonymous
06-12-2002, 11:48 PM
A popular Asian-themed restaurant has opened dozens of locations throughout the U.S. This article demonstrates a simple MapPoint/Access application showing P.F. Chang’s locations in Illinois and Indiana.

Read the full article: http://www.mp2kmag.com/articles.asp?ArticleID=71

Taab
06-20-2004, 11:30 PM
I am able to run this fine in access but when I try to use the same code with MapPoint 2004 it keeps giving me errors. Are there any changes required for Access 2003 or MapPoint 2004?

Thanks,

Tracy Lowell

Eric Frost
06-21-2004, 07:12 AM
Not that I'm aware of.. what are the errors? Do they give some hint of what changes might be required?

Eric

Taab
06-21-2004, 02:50 PM
I am trying to display MapPoint maps in Access just like the one in this article.

I am cutting and pasting the code into access 2003 and using MapPoint 2004 Trial.

The errors seem to center aroung the "objMap" object.

Set objMap = MPC.NewMap(geoMapNorthAmerica)

Run-time error 91
Oject variable or With block variable not set

Run-time error 438
Object doesn't support this property or method

This is the code I am using:

Dim objMap As MapPoint.Map
Dim objPin As MapPoint.Pushpin

Sub Form_Load()

Set objMap = MPC.NewMap(geoMapNorthAmerica)
MPC.Toolbars.Item("Navigation").Visible = True

'This is done in the Form_Load so that the DataSets(1).Delete does not bomb in Form_Current the first time it is run
Set objPin = objMap.AddPushpin(objMap.FindAddressResults(Me!Pro pAddress(P), Me!PropCity(P), , Me!PropState(P),
Me!PropZipPlus4(P))(1))

For Each objPlaceCat In objMap.PlaceCategories
objPlaceCat.Visible = False
Next

End Sub

Private Sub Form_Current()

objMap.DataSets(1).Delete
Set objPin = objMap.AddPushpin(objMap.FindAddressResults(Me!Pro pAddress(P), Me!PropCity(P), , Me!PropState(P),
Me!PropZipPlus4(P))(1))
objPin.Symbol = 57

objMap.DataSets.ZoomTo

End Sub

Private Sub Form_Unload(Cancel As Integer)
objMap.Saved = True
End Sub

I renamed my control to "MPC" and changed the address references.

Any ideas?

Thanks,

Tracy Lowell

Taab
06-21-2004, 10:49 PM
I came accross this note in the MapPoint Help File.

Note With MapPoint 2004, the MapPoint Control is supported only in Microsoft Visual Basic 6.0 or later. This does not include Visual Basic for Applications (for example, the Visual Basic for Applications included with Microsoft Office). It also does not include Microsoft Internet Explorer. You can use MapPoint as an ActiveDocument in Internet Explorer to achieve the same functionality.

This is listed under "Getting started with the MapPoint control."

Thanks for any help,

Tracy Lowell

Taab
06-22-2004, 09:30 AM
The only thing I can come up with is that you use version 9.0 of the MapPoint Active X component and I have 11.0.

Could this be the problem?

Thanks,

Tracy Lowelll

 
Web mp2kmag.com
mapforums.com